@thesingularitynetwork/darkswap-sdk 0.2.6 → 0.2.7-beta1

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.
@@ -2584,6 +2584,26 @@ function _getNullifierBySignature() {
2584
2584
  }));
2585
2585
  return _getNullifierBySignature.apply(this, arguments);
2586
2586
  }
2587
+ function isNoteCreated(_x19, _x20) {
2588
+ return _isNoteCreated.apply(this, arguments);
2589
+ }
2590
+ function _isNoteCreated() {
2591
+ _isNoteCreated = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(darkSwap, note) {
2592
+ var contract, isNotCreated;
2593
+ return _regenerator().w(function (_context8) {
2594
+ while (1) switch (_context8.n) {
2595
+ case 0:
2596
+ contract = getContract(darkSwap.contracts.merkleTreeOperator, darkSwap);
2597
+ _context8.n = 1;
2598
+ return contract.noteIsNotCreated(hexlify32(note));
2599
+ case 1:
2600
+ isNotCreated = _context8.v;
2601
+ return _context8.a(2, !isNotCreated);
2602
+ }
2603
+ }, _callee8);
2604
+ }));
2605
+ return _isNoteCreated.apply(this, arguments);
2606
+ }
2587
2607
 
2588
2608
  var _format$1 = "hh-sol-artifact-1";
2589
2609
  var contractName$1 = "DarkSwapAssetManager";
@@ -4208,13 +4228,19 @@ var ERC20_USDT = {
4208
4228
  ChainId[ChainId["HARDHAT_BASE"] = 31339] = "HARDHAT_BASE";
4209
4229
  ChainId[ChainId["MAINNET"] = 1] = "MAINNET";
4210
4230
  ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
4231
+ ChainId[ChainId["BASE_SEPOLIA"] = 84532] = "BASE_SEPOLIA";
4211
4232
  ChainId[ChainId["HORIZEN_TESTNET"] = 845320009] = "HORIZEN_TESTNET";
4212
4233
  ChainId[ChainId["ARBITRUM_ONE"] = 42161] = "ARBITRUM_ONE";
4213
4234
  ChainId[ChainId["BASE"] = 8453] = "BASE";
4214
4235
  })(exports.ChainId || (exports.ChainId = {}));
4215
4236
 
4216
- var _legacyTokenConfig;
4237
+ var _legacyTokenConfig, _confirmationsConfig;
4217
4238
  var legacyTokenConfig = (_legacyTokenConfig = {}, _legacyTokenConfig[exports.ChainId.MAINNET] = ['0xdac17f958d2ee523a2206206994597c13d831ec7'], _legacyTokenConfig[exports.ChainId.HARDHAT] = ['0xdac17f958d2ee523a2206206994597c13d831ec7'], _legacyTokenConfig);
4239
+ var confirmationsConfig = (_confirmationsConfig = {}, _confirmationsConfig[exports.ChainId.MAINNET] = 3, _confirmationsConfig[exports.ChainId.ARBITRUM_ONE] = 3, _confirmationsConfig[exports.ChainId.BASE] = 3, _confirmationsConfig[exports.ChainId.SEPOLIA] = 3, _confirmationsConfig[exports.ChainId.HARDHAT] = 3, _confirmationsConfig);
4240
+ var DEFAULT_CONFIRMATIONS = 3;
4241
+ var getConfirmations = function getConfirmations(chainId) {
4242
+ return confirmationsConfig[chainId] || DEFAULT_CONFIRMATIONS;
4243
+ };
4218
4244
  var DEFAULT_FEE_RATIO = 300n;
4219
4245
  var GAS_LIMIT_MULTIPLIER = 120n;
4220
4246
  var GAS_LIMIT_PRECISION = 100n;
@@ -4726,8 +4752,7 @@ var contractConfig = (_contractConfig = {}, _contractConfig[exports.ChainId.MAIN
4726
4752
  synaraDarkSwapOnBridgeAssetManager: '0x0',
4727
4753
  synaraBridge: '0x0',
4728
4754
  synaraCanonicalTokenRegistry: '0x0',
4729
- zkverifyRelayerUrls: [],
4730
- darkSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-subgraph/version/v0.0.1/api'
4755
+ zkverifyRelayerUrls: []
4731
4756
  }, _contractConfig[exports.ChainId.ARBITRUM_ONE] = {
4732
4757
  priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
4733
4758
  ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
@@ -4738,32 +4763,40 @@ var contractConfig = (_contractConfig = {}, _contractConfig[exports.ChainId.MAIN
4738
4763
  synaraDarkSwapOnBridgeAssetManager: '0x0',
4739
4764
  synaraBridge: '0x0',
4740
4765
  synaraCanonicalTokenRegistry: '0x0',
4741
- zkverifyRelayerUrls: [],
4742
- darkSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-arb-subgraph/api'
4766
+ zkverifyRelayerUrls: []
4743
4767
  }, _contractConfig[exports.ChainId.BASE] = {
4744
4768
  priceOracle: '0xf224a25453D76A41c4427DD1C05369BC9f498444',
4745
4769
  ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
4746
4770
  nativeWrapper: '0x4200000000000000000000000000000000000006',
4747
- merkleTreeOperator: '0x0',
4748
- darkSwapAssetManager: '0x0',
4749
- darkSwapFeeAssetManager: '0x0',
4771
+ merkleTreeOperator: '0x918B4F76CAE5F67A3818D8eD3d0e11D9888684E9',
4772
+ darkSwapAssetManager: '0x6fbA1F1aAb8449b7ba576E41F4617d918391b7cF',
4773
+ darkSwapFeeAssetManager: '0xfde341e63EB2f25A32D353d58C2DAd7f91c8Bd57',
4750
4774
  synaraDarkSwapOnBridgeAssetManager: '0x0',
4751
4775
  synaraBridge: '0x0',
4752
4776
  synaraCanonicalTokenRegistry: '0x0',
4753
- zkverifyRelayerUrls: [],
4754
- darkSwapSubgraphUrl: 'https://subgraph.satsuma-prod.com/1c6a44a9ed6e/pgs-team--611591/singularity-base-subgraph/api'
4777
+ zkverifyRelayerUrls: []
4755
4778
  }, _contractConfig[exports.ChainId.SEPOLIA] = {
4756
4779
  priceOracle: '0x4Fe44a9aC8Ef059Be2dB97f9e3bcA32Ab698C2f2',
4757
4780
  ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
4758
4781
  nativeWrapper: '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14',
4759
- merkleTreeOperator: '0x0',
4760
- darkSwapAssetManager: '0x0',
4761
- darkSwapFeeAssetManager: '0x0',
4762
- synaraDarkSwapOnBridgeAssetManager: '0x0',
4763
- synaraBridge: '0x0',
4764
- synaraCanonicalTokenRegistry: '0x0',
4765
- zkverifyRelayerUrls: [],
4766
- darkSwapSubgraphUrl: ''
4782
+ merkleTreeOperator: '0xbeCd9FD715d131F8E897095Ef008BB4d9325B744',
4783
+ darkSwapAssetManager: '0x6E56b48361aD94Cb67EB5aA9182b2813bC76E6C0',
4784
+ darkSwapFeeAssetManager: '0x5C550CE1F4a02865F0f59d839D86807C75A6ddE0',
4785
+ synaraDarkSwapOnBridgeAssetManager: '0xEAC8292c1ef7b112Ccd5B3CB16E587E1799358db',
4786
+ synaraBridge: '0x2a9569b5df66B7E24B4FdC2B91d19E4C1C02F2D3',
4787
+ synaraCanonicalTokenRegistry: '0xD35264a934b5b7b8b3507b1d073e29EeBa4Dc754',
4788
+ zkverifyRelayerUrls: []
4789
+ }, _contractConfig[exports.ChainId.BASE_SEPOLIA] = {
4790
+ priceOracle: '0x4Fe44a9aC8Ef059Be2dB97f9e3bcA32Ab698C2f2',
4791
+ ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
4792
+ nativeWrapper: '0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14',
4793
+ merkleTreeOperator: '0xC486e448e068A888AF09c386337E3C3C4812569b',
4794
+ darkSwapAssetManager: '0xEd349302ff6C2527be9555Fa386061652EAC712D',
4795
+ darkSwapFeeAssetManager: '0xa62C0693296f64eb9BA29ff2E41E96749c18de0F',
4796
+ synaraDarkSwapOnBridgeAssetManager: '0x0aAd845E874F0007e328862A3C455CB2D6625660',
4797
+ synaraBridge: '0xda348F7dEAeE972D8a5B4D4D182EF0273aDd3E2c',
4798
+ synaraCanonicalTokenRegistry: '0x016C6334d644E0B21aD5c6e91083Dd2f22739eB6',
4799
+ zkverifyRelayerUrls: []
4767
4800
  }, _contractConfig[exports.ChainId.HORIZEN_TESTNET] = {
4768
4801
  priceOracle: '0x54c375f28ce4B0c2B986D6256E4Bc75d242A8793',
4769
4802
  ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
@@ -4774,8 +4807,7 @@ var contractConfig = (_contractConfig = {}, _contractConfig[exports.ChainId.MAIN
4774
4807
  synaraDarkSwapOnBridgeAssetManager: '0x0',
4775
4808
  synaraBridge: '0x0',
4776
4809
  synaraCanonicalTokenRegistry: '0x0',
4777
- zkverifyRelayerUrls: [],
4778
- darkSwapSubgraphUrl: ''
4810
+ zkverifyRelayerUrls: []
4779
4811
  }, _contractConfig[exports.ChainId.HARDHAT] = {
4780
4812
  priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
4781
4813
  ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
@@ -4786,8 +4818,7 @@ var contractConfig = (_contractConfig = {}, _contractConfig[exports.ChainId.MAIN
4786
4818
  synaraDarkSwapOnBridgeAssetManager: '0x0',
4787
4819
  synaraBridge: '0x0',
4788
4820
  synaraCanonicalTokenRegistry: '0x0',
4789
- zkverifyRelayerUrls: [],
4790
- darkSwapSubgraphUrl: 'https://app.dev.portalgate.me:8080/subgraphs/name/singularity/'
4821
+ zkverifyRelayerUrls: []
4791
4822
  }, _contractConfig[exports.ChainId.HARDHAT_BASE] = {
4792
4823
  priceOracle: '0x0AdDd25a91563696D8567Df78D5A01C9a991F9B8',
4793
4824
  ethAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
@@ -4798,8 +4829,7 @@ var contractConfig = (_contractConfig = {}, _contractConfig[exports.ChainId.MAIN
4798
4829
  synaraDarkSwapOnBridgeAssetManager: '0x0',
4799
4830
  synaraBridge: '0x0',
4800
4831
  synaraCanonicalTokenRegistry: '0x0',
4801
- zkverifyRelayerUrls: [],
4802
- darkSwapSubgraphUrl: 'https://app.dev.portalgate.me:8080/subgraphs/name/singularity/'
4832
+ zkverifyRelayerUrls: []
4803
4833
  }, _contractConfig);
4804
4834
 
4805
4835
  function refineGasLimit(estimatedGas) {
@@ -5030,7 +5060,7 @@ var DepositService = /*#__PURE__*/function (_BaseContractService) {
5030
5060
  case 3:
5031
5061
  tx = _context4.v;
5032
5062
  _context4.n = 4;
5033
- return tx.wait();
5063
+ return tx.wait(getConfirmations(this._darkSwap.chainId));
5034
5064
  case 4:
5035
5065
  return _context4.a(2);
5036
5066
  }
@@ -9368,9 +9398,9 @@ var RetailCreateOrderService = /*#__PURE__*/function (_BaseContractService) {
9368
9398
  }
9369
9399
  _inheritsLoose(RetailCreateOrderService, _BaseContractService);
9370
9400
  var _proto = RetailCreateOrderService.prototype;
9371
- _proto.prepare = /*#__PURE__*/function () {
9372
- var _prepare = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(address, depositAsset, depositAmount, swapInAsset, swapInAmount, signature) {
9373
- var _yield$generateKeyPai, pubKey, privKey, feeRatio, orderNote, feeAmount, realSwapInAmount, swapInNote, context, swapMessage, _t, _t2;
9401
+ _proto.rebuildContextFromSwapMessage = /*#__PURE__*/function () {
9402
+ var _rebuildContextFromSwapMessage = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(swapMessage, signature) {
9403
+ var _yield$generateKeyPai, pubKey, context;
9374
9404
  return _regenerator().w(function (_context) {
9375
9405
  while (1) switch (_context.n) {
9376
9406
  case 0:
@@ -9379,12 +9409,46 @@ var RetailCreateOrderService = /*#__PURE__*/function (_BaseContractService) {
9379
9409
  case 1:
9380
9410
  _yield$generateKeyPai = _context.v;
9381
9411
  pubKey = _yield$generateKeyPai[0];
9382
- privKey = _yield$generateKeyPai[1];
9412
+ if (validateOrderNoteWithPubKey(swapMessage.orderNote, pubKey)) {
9413
+ _context.n = 2;
9414
+ break;
9415
+ }
9416
+ throw new DarkSwapError('SwapMessage does not belong to this wallet');
9417
+ case 2:
9418
+ context = new RetailCreateOrderContext(signature);
9419
+ context.orderNote = swapMessage.orderNote;
9420
+ context.swapInNote = swapMessage.inNote;
9421
+ context.feeAmount = swapMessage.feeAmount;
9422
+ context.address = swapMessage.address;
9423
+ _context.n = 3;
9424
+ return this.generateProof(context);
9425
+ case 3:
9426
+ return _context.a(2, context);
9427
+ }
9428
+ }, _callee, this);
9429
+ }));
9430
+ function rebuildContextFromSwapMessage(_x, _x2) {
9431
+ return _rebuildContextFromSwapMessage.apply(this, arguments);
9432
+ }
9433
+ return rebuildContextFromSwapMessage;
9434
+ }();
9435
+ _proto.prepare = /*#__PURE__*/function () {
9436
+ var _prepare = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(address, depositAsset, depositAmount, swapInAsset, swapInAmount, signature) {
9437
+ var _yield$generateKeyPai2, pubKey, privKey, feeRatio, orderNote, feeAmount, realSwapInAmount, swapInNote, context, swapMessage, _t, _t2;
9438
+ return _regenerator().w(function (_context2) {
9439
+ while (1) switch (_context2.n) {
9440
+ case 0:
9441
+ _context2.n = 1;
9442
+ return generateKeyPair(signature);
9443
+ case 1:
9444
+ _yield$generateKeyPai2 = _context2.v;
9445
+ pubKey = _yield$generateKeyPai2[0];
9446
+ privKey = _yield$generateKeyPai2[1];
9383
9447
  _t = BigInt;
9384
- _context.n = 2;
9448
+ _context2.n = 2;
9385
9449
  return getFeeRatio(address, this._darkSwap);
9386
9450
  case 2:
9387
- _t2 = _context.v;
9451
+ _t2 = _context2.v;
9388
9452
  feeRatio = _t(_t2);
9389
9453
  orderNote = createOrderNoteExt(address, depositAsset, depositAmount, feeRatio, pubKey);
9390
9454
  feeAmount = calcFeeAmount(swapInAmount, feeRatio);
@@ -9395,36 +9459,36 @@ var RetailCreateOrderService = /*#__PURE__*/function (_BaseContractService) {
9395
9459
  context.swapInNote = swapInNote;
9396
9460
  context.feeAmount = feeAmount;
9397
9461
  context.address = address;
9398
- _context.n = 3;
9462
+ _context2.n = 3;
9399
9463
  return generateRetailSwapMessage(address, orderNote, swapInNote, feeAmount, pubKey, privKey);
9400
9464
  case 3:
9401
- swapMessage = _context.v;
9465
+ swapMessage = _context2.v;
9402
9466
  context.swapMessage = swapMessage;
9403
- return _context.a(2, {
9467
+ return _context2.a(2, {
9404
9468
  context: context,
9405
9469
  swapMessage: swapMessage
9406
9470
  });
9407
9471
  }
9408
- }, _callee, this);
9472
+ }, _callee2, this);
9409
9473
  }));
9410
- function prepare(_x, _x2, _x3, _x4, _x5, _x6) {
9474
+ function prepare(_x3, _x4, _x5, _x6, _x7, _x8) {
9411
9475
  return _prepare.apply(this, arguments);
9412
9476
  }
9413
9477
  return prepare;
9414
9478
  }();
9415
9479
  _proto.generateProof = /*#__PURE__*/function () {
9416
- var _generateProof = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(context) {
9480
+ var _generateProof = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(context) {
9417
9481
  var proof;
9418
- return _regenerator().w(function (_context2) {
9419
- while (1) switch (_context2.n) {
9482
+ return _regenerator().w(function (_context3) {
9483
+ while (1) switch (_context3.n) {
9420
9484
  case 0:
9421
9485
  if (!(!context || !context.orderNote || !context.swapInNote || !context.address || !context.feeAmount || !context.signature)) {
9422
- _context2.n = 1;
9486
+ _context3.n = 1;
9423
9487
  break;
9424
9488
  }
9425
9489
  throw new DarkSwapError('Invalid context');
9426
9490
  case 1:
9427
- _context2.n = 2;
9491
+ _context3.n = 2;
9428
9492
  return generateRetailCreateOrderProof({
9429
9493
  depositNote: context.orderNote,
9430
9494
  swapInNote: context.swapInNote,
@@ -9433,71 +9497,77 @@ var RetailCreateOrderService = /*#__PURE__*/function (_BaseContractService) {
9433
9497
  feeAmount: context.feeAmount
9434
9498
  });
9435
9499
  case 2:
9436
- proof = _context2.v;
9500
+ proof = _context3.v;
9437
9501
  context.proof = proof;
9438
9502
  case 3:
9439
- return _context2.a(2);
9503
+ return _context3.a(2);
9440
9504
  }
9441
- }, _callee2);
9505
+ }, _callee3);
9442
9506
  }));
9443
- function generateProof(_x7) {
9507
+ function generateProof(_x9) {
9444
9508
  return _generateProof.apply(this, arguments);
9445
9509
  }
9446
9510
  return generateProof;
9447
9511
  }();
9448
9512
  _proto.allowance = /*#__PURE__*/function () {
9449
- var _allowance = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(context) {
9513
+ var _allowance = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(context) {
9450
9514
  var signer, asset, amount, allowanceContract, allowance, isLegacy, contract, tx;
9451
- return _regenerator().w(function (_context3) {
9452
- while (1) switch (_context3.n) {
9515
+ return _regenerator().w(function (_context4) {
9516
+ while (1) switch (_context4.n) {
9453
9517
  case 0:
9454
9518
  if (!(!context || !context.orderNote || !context.address || !context.signature || !context.proof)) {
9455
- _context3.n = 1;
9519
+ _context4.n = 1;
9456
9520
  break;
9457
9521
  }
9458
9522
  throw new DarkSwapError('Invalid context');
9459
9523
  case 1:
9524
+ if (!isNativeAsset(context.orderNote.asset)) {
9525
+ _context4.n = 2;
9526
+ break;
9527
+ }
9528
+ return _context4.a(2);
9529
+ case 2:
9460
9530
  signer = this._darkSwap.signer;
9461
9531
  asset = context.orderNote.asset;
9462
9532
  amount = context.orderNote.amount;
9463
9533
  allowanceContract = new ethers.ethers.Contract(asset, ERC20Abi.abi, this._darkSwap);
9464
- _context3.n = 2;
9534
+ _context4.n = 3;
9465
9535
  return allowanceContract.allowance(signer.getAddress(), this._darkSwap.contracts.darkSwapAssetManager);
9466
- case 2:
9467
- allowance = _context3.v;
9536
+ case 3:
9537
+ allowance = _context4.v;
9468
9538
  if (!(BigInt(allowance) < amount)) {
9469
- _context3.n = 4;
9539
+ _context4.n = 5;
9470
9540
  break;
9471
9541
  }
9472
9542
  isLegacy = legacyTokenConfig.hasOwnProperty(this._darkSwap.chainId) && legacyTokenConfig[this._darkSwap.chainId].includes(asset.toLowerCase());
9473
9543
  contract = new ethers.ethers.Contract(asset, isLegacy ? ERC20_USDT.abi : ERC20Abi.abi, signer);
9474
- _context3.n = 3;
9544
+ _context4.n = 4;
9475
9545
  return contract.approve(this._darkSwap.contracts.darkSwapAssetManager, hexlify32(MAX_ALLOWANCE));
9476
- case 3:
9477
- tx = _context3.v;
9478
- _context3.n = 4;
9479
- return tx.wait();
9480
9546
  case 4:
9481
- return _context3.a(2);
9547
+ tx = _context4.v;
9548
+ _context4.n = 5;
9549
+ return tx.wait(getConfirmations(this._darkSwap.chainId));
9550
+ case 5:
9551
+ return _context4.a(2);
9482
9552
  }
9483
- }, _callee3, this);
9553
+ }, _callee4, this);
9484
9554
  }));
9485
- function allowance(_x8) {
9555
+ function allowance(_x0) {
9486
9556
  return _allowance.apply(this, arguments);
9487
9557
  }
9488
9558
  return allowance;
9489
9559
  }();
9490
9560
  _proto.execute = /*#__PURE__*/function () {
9491
- var _execute = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(context) {
9561
+ var _execute = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(context) {
9492
9562
  var contract, ethAmount, tx;
9493
- return _regenerator().w(function (_context4) {
9494
- while (1) switch (_context4.n) {
9563
+ return _regenerator().w(function (_context5) {
9564
+ while (1) switch (_context5.n) {
9495
9565
  case 0:
9496
- _context4.n = 1;
9566
+ _context5.n = 1;
9497
9567
  return this.generateProof(context);
9498
9568
  case 1:
9499
9569
  if (!(!context || !context.orderNote || !context.swapInNote || !context.proof)) {
9500
- _context4.n = 2;
9570
+ _context5.n = 2;
9501
9571
  break;
9502
9572
  }
9503
9573
  throw new DarkSwapError('Invalid context');
@@ -9505,30 +9575,30 @@ var RetailCreateOrderService = /*#__PURE__*/function (_BaseContractService) {
9505
9575
  contract = new ethers.ethers.Contract(this._darkSwap.contracts.darkSwapAssetManager, DarkSwapAssetManagerAbi.abi, this._darkSwap.signer);
9506
9576
  ethAmount = 0n;
9507
9577
  if (!isNativeAsset(context.orderNote.asset)) {
9508
- _context4.n = 3;
9578
+ _context5.n = 3;
9509
9579
  break;
9510
9580
  }
9511
9581
  ethAmount = context.orderNote.amount;
9512
- _context4.n = 4;
9582
+ _context5.n = 4;
9513
9583
  break;
9514
9584
  case 3:
9515
- _context4.n = 4;
9585
+ _context5.n = 4;
9516
9586
  return this.allowance(context);
9517
9587
  case 4:
9518
- _context4.n = 5;
9588
+ _context5.n = 5;
9519
9589
  return contract.retailDepositCreateOrder([hexlify32(context.orderNote.note), context.proof.depositFooter, context.orderNote.asset, bn_to_0xhex(context.orderNote.amount), hexlify32(context.swapInNote.note), context.proof.swapInNoteFooter], context.proof.proof, {
9520
9590
  value: bn_to_0xhex(ethAmount)
9521
9591
  });
9522
9592
  case 5:
9523
- tx = _context4.v;
9524
- _context4.n = 6;
9593
+ tx = _context5.v;
9594
+ _context5.n = 6;
9525
9595
  return tx.wait();
9526
9596
  case 6:
9527
- return _context4.a(2, tx.hash);
9597
+ return _context5.a(2, tx.hash);
9528
9598
  }
9529
- }, _callee4, this);
9599
+ }, _callee5, this);
9530
9600
  }));
9531
- function execute(_x9) {
9601
+ function execute(_x1) {
9532
9602
  return _execute.apply(this, arguments);
9533
9603
  }
9534
9604
  return execute;
@@ -9878,7 +9948,7 @@ function generateRetailSwapProof(_x) {
9878
9948
  }
9879
9949
  function _generateRetailSwapProof() {
9880
9950
  _generateRetailSwapProof = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(param) {
9881
- var aliceFeeAmount, bobFeeAmount, aliceOrderNoteNullifier, aliceInNoteFooter, bobOrderNoteNullifier, bobInNoteFooter, aliceAddressMod, bobAddressMod, inputs, proof;
9951
+ var aliceOrderNoteNullifier, aliceInNoteFooter, bobOrderNoteNullifier, bobInNoteFooter, aliceAddressMod, bobAddressMod, inputs, proof;
9882
9952
  return _regenerator().w(function (_context) {
9883
9953
  while (1) switch (_context.n) {
9884
9954
  case 0:
@@ -9894,14 +9964,12 @@ function _generateRetailSwapProof() {
9894
9964
  }
9895
9965
  throw new DarkSwapProofError("Invalid note amount");
9896
9966
  case 2:
9897
- if (!(param.aliceMessage.orderNote.amount != param.bobMessage.inNote.amount || param.bobMessage.orderNote.amount != param.aliceMessage.inNote.amount)) {
9967
+ if (!(param.aliceMessage.orderNote.amount != param.bobMessage.inNote.amount + param.bobMessage.feeAmount || param.bobMessage.orderNote.amount != param.aliceMessage.inNote.amount + param.aliceMessage.feeAmount)) {
9898
9968
  _context.n = 3;
9899
9969
  break;
9900
9970
  }
9901
9971
  throw new DarkSwapProofError("Invalid order amount");
9902
9972
  case 3:
9903
- aliceFeeAmount = param.aliceMessage.inNote.amount * param.aliceMessage.orderNote.feeRatio / FEE_RATIO_PRECISION;
9904
- bobFeeAmount = param.bobMessage.inNote.amount * param.bobMessage.orderNote.feeRatio / FEE_RATIO_PRECISION;
9905
9973
  aliceOrderNoteNullifier = calcNullifier(param.aliceMessage.orderNote.rho, param.aliceMessage.publicKey);
9906
9974
  aliceInNoteFooter = getNoteFooter(param.aliceMessage.inNote.rho, param.aliceMessage.publicKey);
9907
9975
  bobOrderNoteNullifier = calcNullifier(param.bobMessage.orderNote.rho, param.bobMessage.publicKey);
@@ -9921,10 +9989,10 @@ function _generateRetailSwapProof() {
9921
9989
  alice_out_note: bn_to_0xhex(param.aliceMessage.orderNote.note),
9922
9990
  alice_out_nullifier: bn_to_0xhex(aliceOrderNoteNullifier),
9923
9991
  alice_fee_ratio: bn_to_0xhex(param.aliceMessage.orderNote.feeRatio),
9924
- alice_fee_amount: bn_to_0xhex(aliceFeeAmount),
9992
+ alice_fee_amount: bn_to_0xhex(param.aliceMessage.feeAmount),
9925
9993
  alice_in_rho: bn_to_0xhex(param.aliceMessage.inNote.rho),
9926
9994
  alice_in_asset: bn_to_0xhex(encodeAddress(param.aliceMessage.inNote.asset)),
9927
- alice_in_amount: bn_to_0xhex(param.aliceMessage.inNote.amount),
9995
+ alice_in_amount: bn_to_0xhex(param.aliceMessage.inNote.amount + param.aliceMessage.feeAmount),
9928
9996
  alice_in_note: bn_to_0xhex(param.aliceMessage.inNote.note),
9929
9997
  alice_in_note_footer: bn_to_0xhex(aliceInNoteFooter),
9930
9998
  alice_pub_key: [param.aliceMessage.publicKey[0].toString(), param.aliceMessage.publicKey[1].toString()],
@@ -9938,7 +10006,7 @@ function _generateRetailSwapProof() {
9938
10006
  bob_out_rho: bn_to_0xhex(param.bobMessage.orderNote.rho),
9939
10007
  bob_out_nullifier: bn_to_0xhex(bobOrderNoteNullifier),
9940
10008
  bob_fee_ratio: bn_to_0xhex(param.bobMessage.orderNote.feeRatio),
9941
- bob_fee_amount: bn_to_0xhex(bobFeeAmount),
10009
+ bob_fee_amount: bn_to_0xhex(param.bobMessage.feeAmount),
9942
10010
  bob_in_note: bn_to_0xhex(param.bobMessage.inNote.note),
9943
10011
  bob_in_rho: bn_to_0xhex(param.bobMessage.inNote.rho),
9944
10012
  bob_in_note_footer: bn_to_0xhex(bobInNoteFooter),
@@ -11119,10 +11187,7 @@ var SynaraDarkSwapOnBridgeAssetManagerAbi = {
11119
11187
  deployedLinkReferences: deployedLinkReferences$5
11120
11188
  };
11121
11189
 
11122
- var _format$6 = "hh-sol-artifact-1";
11123
- var contractName$6 = "CanonicalTokenRegistry";
11124
- var sourceName$6 = "src/CanonicalTokenRegistry.sol";
11125
- var abi$h = [
11190
+ var CanonicalTokenRegistryAbi = [
11126
11191
  {
11127
11192
  inputs: [
11128
11193
  ],
@@ -11169,12 +11234,6 @@ var abi$h = [
11169
11234
  name: "ExpectedPause",
11170
11235
  type: "error"
11171
11236
  },
11172
- {
11173
- inputs: [
11174
- ],
11175
- name: "NotMapped",
11176
- type: "error"
11177
- },
11178
11237
  {
11179
11238
  inputs: [
11180
11239
  ],
@@ -11183,43 +11242,34 @@ var abi$h = [
11183
11242
  },
11184
11243
  {
11185
11244
  inputs: [
11186
- {
11187
- internalType: "address",
11188
- name: "owner",
11189
- type: "address"
11190
- }
11191
- ],
11192
- name: "OwnableInvalidOwner",
11193
- type: "error"
11194
- },
11195
- {
11196
- inputs: [
11197
- {
11198
- internalType: "address",
11199
- name: "account",
11200
- type: "address"
11201
- }
11202
11245
  ],
11203
- name: "OwnableUnauthorizedAccount",
11246
+ name: "TokenAlreadyMapped",
11204
11247
  type: "error"
11205
11248
  },
11206
11249
  {
11207
11250
  inputs: [
11208
11251
  ],
11209
- name: "TokenLocked",
11252
+ name: "ZeroAddress",
11210
11253
  type: "error"
11211
11254
  },
11212
11255
  {
11213
11256
  inputs: [
11214
11257
  ],
11215
- name: "TokenNotActive",
11258
+ name: "ZeroCanonicalId",
11216
11259
  type: "error"
11217
11260
  },
11218
11261
  {
11262
+ anonymous: false,
11219
11263
  inputs: [
11264
+ {
11265
+ indexed: false,
11266
+ internalType: "address",
11267
+ name: "account",
11268
+ type: "address"
11269
+ }
11220
11270
  ],
11221
- name: "ZeroAddress",
11222
- type: "error"
11271
+ name: "Paused",
11272
+ type: "event"
11223
11273
  },
11224
11274
  {
11225
11275
  anonymous: false,
@@ -11227,48 +11277,48 @@ var abi$h = [
11227
11277
  {
11228
11278
  indexed: true,
11229
11279
  internalType: "bytes32",
11230
- name: "canonicalId",
11280
+ name: "role",
11231
11281
  type: "bytes32"
11232
11282
  },
11233
11283
  {
11234
- indexed: false,
11235
- internalType: "uint256",
11236
- name: "originChainId",
11237
- type: "uint256"
11238
- },
11239
- {
11240
- indexed: false,
11241
- internalType: "address",
11242
- name: "originToken",
11243
- type: "address"
11284
+ indexed: true,
11285
+ internalType: "bytes32",
11286
+ name: "previousAdminRole",
11287
+ type: "bytes32"
11244
11288
  },
11245
11289
  {
11246
- indexed: false,
11247
- internalType: "uint8",
11248
- name: "decimals",
11249
- type: "uint8"
11290
+ indexed: true,
11291
+ internalType: "bytes32",
11292
+ name: "newAdminRole",
11293
+ type: "bytes32"
11250
11294
  }
11251
11295
  ],
11252
- name: "CanonicalRegistered",
11296
+ name: "RoleAdminChanged",
11253
11297
  type: "event"
11254
11298
  },
11255
11299
  {
11256
11300
  anonymous: false,
11257
11301
  inputs: [
11302
+ {
11303
+ indexed: true,
11304
+ internalType: "bytes32",
11305
+ name: "role",
11306
+ type: "bytes32"
11307
+ },
11258
11308
  {
11259
11309
  indexed: true,
11260
11310
  internalType: "address",
11261
- name: "previousOwner",
11311
+ name: "account",
11262
11312
  type: "address"
11263
11313
  },
11264
11314
  {
11265
11315
  indexed: true,
11266
11316
  internalType: "address",
11267
- name: "newOwner",
11317
+ name: "sender",
11268
11318
  type: "address"
11269
11319
  }
11270
11320
  ],
11271
- name: "OwnershipTransferStarted",
11321
+ name: "RoleGranted",
11272
11322
  type: "event"
11273
11323
  },
11274
11324
  {
@@ -11276,31 +11326,24 @@ var abi$h = [
11276
11326
  inputs: [
11277
11327
  {
11278
11328
  indexed: true,
11279
- internalType: "address",
11280
- name: "previousOwner",
11281
- type: "address"
11329
+ internalType: "bytes32",
11330
+ name: "role",
11331
+ type: "bytes32"
11282
11332
  },
11283
11333
  {
11284
11334
  indexed: true,
11285
11335
  internalType: "address",
11286
- name: "newOwner",
11336
+ name: "account",
11287
11337
  type: "address"
11288
- }
11289
- ],
11290
- name: "OwnershipTransferred",
11291
- type: "event"
11292
- },
11293
- {
11294
- anonymous: false,
11295
- inputs: [
11338
+ },
11296
11339
  {
11297
- indexed: false,
11340
+ indexed: true,
11298
11341
  internalType: "address",
11299
- name: "account",
11342
+ name: "sender",
11300
11343
  type: "address"
11301
11344
  }
11302
11345
  ],
11303
- name: "Paused",
11346
+ name: "RoleRevoked",
11304
11347
  type: "event"
11305
11348
  },
11306
11349
  {
@@ -11313,19 +11356,13 @@ var abi$h = [
11313
11356
  type: "bytes32"
11314
11357
  },
11315
11358
  {
11316
- indexed: false,
11317
- internalType: "uint256",
11318
- name: "chainId",
11319
- type: "uint256"
11320
- },
11321
- {
11322
- indexed: false,
11359
+ indexed: true,
11323
11360
  internalType: "address",
11324
11361
  name: "token",
11325
11362
  type: "address"
11326
11363
  }
11327
11364
  ],
11328
- name: "RepresentationMapped",
11365
+ name: "TokenMappingRemoved",
11329
11366
  type: "event"
11330
11367
  },
11331
11368
  {
@@ -11338,150 +11375,36 @@ var abi$h = [
11338
11375
  type: "bytes32"
11339
11376
  },
11340
11377
  {
11341
- indexed: false,
11342
- internalType: "uint256",
11343
- name: "chainId",
11344
- type: "uint256"
11345
- },
11346
- {
11347
- indexed: false,
11378
+ indexed: true,
11348
11379
  internalType: "address",
11349
11380
  name: "token",
11350
11381
  type: "address"
11351
11382
  }
11352
11383
  ],
11353
- name: "RepresentationUnmapped",
11384
+ name: "TokenMappingSet",
11354
11385
  type: "event"
11355
11386
  },
11356
11387
  {
11357
11388
  anonymous: false,
11358
11389
  inputs: [
11359
11390
  {
11360
- indexed: true,
11361
- internalType: "bytes32",
11362
- name: "role",
11363
- type: "bytes32"
11364
- },
11365
- {
11366
- indexed: true,
11367
- internalType: "bytes32",
11368
- name: "previousAdminRole",
11369
- type: "bytes32"
11370
- },
11371
- {
11372
- indexed: true,
11373
- internalType: "bytes32",
11374
- name: "newAdminRole",
11375
- type: "bytes32"
11391
+ indexed: false,
11392
+ internalType: "address",
11393
+ name: "account",
11394
+ type: "address"
11376
11395
  }
11377
11396
  ],
11378
- name: "RoleAdminChanged",
11397
+ name: "Unpaused",
11379
11398
  type: "event"
11380
11399
  },
11381
11400
  {
11382
- anonymous: false,
11383
11401
  inputs: [
11402
+ ],
11403
+ name: "DEFAULT_ADMIN_ROLE",
11404
+ outputs: [
11384
11405
  {
11385
- indexed: true,
11386
11406
  internalType: "bytes32",
11387
- name: "role",
11388
- type: "bytes32"
11389
- },
11390
- {
11391
- indexed: true,
11392
- internalType: "address",
11393
- name: "account",
11394
- type: "address"
11395
- },
11396
- {
11397
- indexed: true,
11398
- internalType: "address",
11399
- name: "sender",
11400
- type: "address"
11401
- }
11402
- ],
11403
- name: "RoleGranted",
11404
- type: "event"
11405
- },
11406
- {
11407
- anonymous: false,
11408
- inputs: [
11409
- {
11410
- indexed: true,
11411
- internalType: "bytes32",
11412
- name: "role",
11413
- type: "bytes32"
11414
- },
11415
- {
11416
- indexed: true,
11417
- internalType: "address",
11418
- name: "account",
11419
- type: "address"
11420
- },
11421
- {
11422
- indexed: true,
11423
- internalType: "address",
11424
- name: "sender",
11425
- type: "address"
11426
- }
11427
- ],
11428
- name: "RoleRevoked",
11429
- type: "event"
11430
- },
11431
- {
11432
- anonymous: false,
11433
- inputs: [
11434
- {
11435
- indexed: true,
11436
- internalType: "bytes32",
11437
- name: "canonicalId",
11438
- type: "bytes32"
11439
- },
11440
- {
11441
- indexed: false,
11442
- internalType: "enum ICanonicalTokenRegistry.TokenStatus",
11443
- name: "status",
11444
- type: "uint8"
11445
- }
11446
- ],
11447
- name: "TokenStatusChanged",
11448
- type: "event"
11449
- },
11450
- {
11451
- anonymous: false,
11452
- inputs: [
11453
- {
11454
- indexed: false,
11455
- internalType: "address",
11456
- name: "account",
11457
- type: "address"
11458
- }
11459
- ],
11460
- name: "Unpaused",
11461
- type: "event"
11462
- },
11463
- {
11464
- inputs: [
11465
- ],
11466
- name: "CANONICAL_SALT",
11467
- outputs: [
11468
- {
11469
- internalType: "bytes32",
11470
- name: "",
11471
- type: "bytes32"
11472
- }
11473
- ],
11474
- stateMutability: "view",
11475
- type: "function"
11476
- },
11477
- {
11478
- inputs: [
11479
- ],
11480
- name: "DEFAULT_ADMIN_ROLE",
11481
- outputs: [
11482
- {
11483
- internalType: "bytes32",
11484
- name: "",
11407
+ name: "",
11485
11408
  type: "bytes32"
11486
11409
  }
11487
11410
  ],
@@ -11502,20 +11425,6 @@ var abi$h = [
11502
11425
  stateMutability: "view",
11503
11426
  type: "function"
11504
11427
  },
11505
- {
11506
- inputs: [
11507
- ],
11508
- name: "NATIVE_TOKEN",
11509
- outputs: [
11510
- {
11511
- internalType: "address",
11512
- name: "",
11513
- type: "address"
11514
- }
11515
- ],
11516
- stateMutability: "view",
11517
- type: "function"
11518
- },
11519
11428
  {
11520
11429
  inputs: [
11521
11430
  ],
@@ -11532,135 +11441,6 @@ var abi$h = [
11532
11441
  },
11533
11442
  {
11534
11443
  inputs: [
11535
- ],
11536
- name: "acceptOwnership",
11537
- outputs: [
11538
- ],
11539
- stateMutability: "nonpayable",
11540
- type: "function"
11541
- },
11542
- {
11543
- inputs: [
11544
- {
11545
- internalType: "bytes32",
11546
- name: "canonicalId",
11547
- type: "bytes32"
11548
- }
11549
- ],
11550
- name: "canDeposit",
11551
- outputs: [
11552
- {
11553
- internalType: "bool",
11554
- name: "",
11555
- type: "bool"
11556
- }
11557
- ],
11558
- stateMutability: "view",
11559
- type: "function"
11560
- },
11561
- {
11562
- inputs: [
11563
- {
11564
- internalType: "bytes32",
11565
- name: "canonicalId",
11566
- type: "bytes32"
11567
- }
11568
- ],
11569
- name: "canWithdraw",
11570
- outputs: [
11571
- {
11572
- internalType: "bool",
11573
- name: "",
11574
- type: "bool"
11575
- }
11576
- ],
11577
- stateMutability: "view",
11578
- type: "function"
11579
- },
11580
- {
11581
- inputs: [
11582
- {
11583
- internalType: "bytes32",
11584
- name: "canonicalId",
11585
- type: "bytes32"
11586
- }
11587
- ],
11588
- name: "canonicalDecimals",
11589
- outputs: [
11590
- {
11591
- internalType: "uint8",
11592
- name: "",
11593
- type: "uint8"
11594
- }
11595
- ],
11596
- stateMutability: "view",
11597
- type: "function"
11598
- },
11599
- {
11600
- inputs: [
11601
- {
11602
- internalType: "uint256",
11603
- name: "originChainId",
11604
- type: "uint256"
11605
- },
11606
- {
11607
- internalType: "address",
11608
- name: "originToken",
11609
- type: "address"
11610
- }
11611
- ],
11612
- name: "computeCanonicalId",
11613
- outputs: [
11614
- {
11615
- internalType: "bytes32",
11616
- name: "",
11617
- type: "bytes32"
11618
- }
11619
- ],
11620
- stateMutability: "pure",
11621
- type: "function"
11622
- },
11623
- {
11624
- inputs: [
11625
- {
11626
- internalType: "bytes32",
11627
- name: "canonicalId",
11628
- type: "bytes32"
11629
- }
11630
- ],
11631
- name: "getCanonical",
11632
- outputs: [
11633
- {
11634
- internalType: "uint256",
11635
- name: "originChainId",
11636
- type: "uint256"
11637
- },
11638
- {
11639
- internalType: "address",
11640
- name: "originToken",
11641
- type: "address"
11642
- },
11643
- {
11644
- internalType: "uint8",
11645
- name: "decimals",
11646
- type: "uint8"
11647
- },
11648
- {
11649
- internalType: "enum ICanonicalTokenRegistry.TokenStatus",
11650
- name: "status",
11651
- type: "uint8"
11652
- }
11653
- ],
11654
- stateMutability: "view",
11655
- type: "function"
11656
- },
11657
- {
11658
- inputs: [
11659
- {
11660
- internalType: "uint256",
11661
- name: "chainId",
11662
- type: "uint256"
11663
- },
11664
11444
  {
11665
11445
  internalType: "address",
11666
11446
  name: "token",
@@ -11705,12 +11485,12 @@ var abi$h = [
11705
11485
  type: "bytes32"
11706
11486
  }
11707
11487
  ],
11708
- name: "getTokenStatus",
11488
+ name: "getToken",
11709
11489
  outputs: [
11710
11490
  {
11711
- internalType: "enum ICanonicalTokenRegistry.TokenStatus",
11491
+ internalType: "address",
11712
11492
  name: "",
11713
- type: "uint8"
11493
+ type: "address"
11714
11494
  }
11715
11495
  ],
11716
11496
  stateMutability: "view",
@@ -11759,25 +11539,6 @@ var abi$h = [
11759
11539
  stateMutability: "view",
11760
11540
  type: "function"
11761
11541
  },
11762
- {
11763
- inputs: [
11764
- {
11765
- internalType: "bytes32",
11766
- name: "canonicalId",
11767
- type: "bytes32"
11768
- }
11769
- ],
11770
- name: "isActive",
11771
- outputs: [
11772
- {
11773
- internalType: "bool",
11774
- name: "",
11775
- type: "bool"
11776
- }
11777
- ],
11778
- stateMutability: "view",
11779
- type: "function"
11780
- },
11781
11542
  {
11782
11543
  inputs: [
11783
11544
  {
@@ -11797,44 +11558,6 @@ var abi$h = [
11797
11558
  stateMutability: "view",
11798
11559
  type: "function"
11799
11560
  },
11800
- {
11801
- inputs: [
11802
- {
11803
- internalType: "uint256",
11804
- name: "chainId",
11805
- type: "uint256"
11806
- },
11807
- {
11808
- internalType: "address",
11809
- name: "token",
11810
- type: "address"
11811
- },
11812
- {
11813
- internalType: "bytes32",
11814
- name: "canonicalId",
11815
- type: "bytes32"
11816
- }
11817
- ],
11818
- name: "mapRepresentation",
11819
- outputs: [
11820
- ],
11821
- stateMutability: "nonpayable",
11822
- type: "function"
11823
- },
11824
- {
11825
- inputs: [
11826
- ],
11827
- name: "owner",
11828
- outputs: [
11829
- {
11830
- internalType: "address",
11831
- name: "",
11832
- type: "address"
11833
- }
11834
- ],
11835
- stateMutability: "view",
11836
- type: "function"
11837
- },
11838
11561
  {
11839
11562
  inputs: [
11840
11563
  ],
@@ -11860,51 +11583,13 @@ var abi$h = [
11860
11583
  },
11861
11584
  {
11862
11585
  inputs: [
11863
- ],
11864
- name: "pendingOwner",
11865
- outputs: [
11866
- {
11867
- internalType: "address",
11868
- name: "",
11869
- type: "address"
11870
- }
11871
- ],
11872
- stateMutability: "view",
11873
- type: "function"
11874
- },
11875
- {
11876
- inputs: [
11877
- {
11878
- internalType: "uint256",
11879
- name: "originChainId",
11880
- type: "uint256"
11881
- },
11882
- {
11883
- internalType: "address",
11884
- name: "originToken",
11885
- type: "address"
11886
- },
11887
- {
11888
- internalType: "uint8",
11889
- name: "decimals",
11890
- type: "uint8"
11891
- }
11892
- ],
11893
- name: "registerCanonical",
11894
- outputs: [
11895
11586
  {
11896
11587
  internalType: "bytes32",
11897
11588
  name: "canonicalId",
11898
11589
  type: "bytes32"
11899
11590
  }
11900
11591
  ],
11901
- stateMutability: "nonpayable",
11902
- type: "function"
11903
- },
11904
- {
11905
- inputs: [
11906
- ],
11907
- name: "renounceOwnership",
11592
+ name: "removeTokenMapping",
11908
11593
  outputs: [
11909
11594
  ],
11910
11595
  stateMutability: "nonpayable",
@@ -11956,12 +11641,12 @@ var abi$h = [
11956
11641
  type: "bytes32"
11957
11642
  },
11958
11643
  {
11959
- internalType: "enum ICanonicalTokenRegistry.TokenStatus",
11960
- name: "status",
11961
- type: "uint8"
11644
+ internalType: "address",
11645
+ name: "token",
11646
+ type: "address"
11962
11647
  }
11963
11648
  ],
11964
- name: "setTokenStatus",
11649
+ name: "setTokenMapping",
11965
11650
  outputs: [
11966
11651
  ],
11967
11652
  stateMutability: "nonpayable",
@@ -11986,39 +11671,6 @@ var abi$h = [
11986
11671
  stateMutability: "view",
11987
11672
  type: "function"
11988
11673
  },
11989
- {
11990
- inputs: [
11991
- {
11992
- internalType: "address",
11993
- name: "newOwner",
11994
- type: "address"
11995
- }
11996
- ],
11997
- name: "transferOwnership",
11998
- outputs: [
11999
- ],
12000
- stateMutability: "nonpayable",
12001
- type: "function"
12002
- },
12003
- {
12004
- inputs: [
12005
- {
12006
- internalType: "uint256",
12007
- name: "chainId",
12008
- type: "uint256"
12009
- },
12010
- {
12011
- internalType: "address",
12012
- name: "token",
12013
- type: "address"
12014
- }
12015
- ],
12016
- name: "unmapRepresentation",
12017
- outputs: [
12018
- ],
12019
- stateMutability: "nonpayable",
12020
- type: "function"
12021
- },
12022
11674
  {
12023
11675
  inputs: [
12024
11676
  ],
@@ -12029,27 +11681,11 @@ var abi$h = [
12029
11681
  type: "function"
12030
11682
  }
12031
11683
  ];
12032
- var bytecode$h = "";
12033
- var deployedBytecode$6 = "";
12034
- var linkReferences$6 = {
12035
- };
12036
- var deployedLinkReferences$6 = {
12037
- };
12038
- var CanonicalTokenRegistryAbi = {
12039
- _format: _format$6,
12040
- contractName: contractName$6,
12041
- sourceName: sourceName$6,
12042
- abi: abi$h,
12043
- bytecode: bytecode$h,
12044
- deployedBytecode: deployedBytecode$6,
12045
- linkReferences: linkReferences$6,
12046
- deployedLinkReferences: deployedLinkReferences$6
12047
- };
12048
11684
 
12049
- var _format$7 = "hh-sol-artifact-1";
12050
- var contractName$7 = "Bridge";
12051
- var sourceName$7 = "src/Bridge.sol";
12052
- var abi$i = [
11685
+ var _format$6 = "hh-sol-artifact-1";
11686
+ var contractName$6 = "Bridge";
11687
+ var sourceName$6 = "src/Bridge.sol";
11688
+ var abi$h = [
12053
11689
  {
12054
11690
  inputs: [
12055
11691
  {
@@ -13004,21 +12640,21 @@ var abi$i = [
13004
12640
  type: "function"
13005
12641
  }
13006
12642
  ];
13007
- var bytecode$i = "";
13008
- var deployedBytecode$7 = "";
13009
- var linkReferences$7 = {
12643
+ var bytecode$h = "";
12644
+ var deployedBytecode$6 = "";
12645
+ var linkReferences$6 = {
13010
12646
  };
13011
- var deployedLinkReferences$7 = {
12647
+ var deployedLinkReferences$6 = {
13012
12648
  };
13013
12649
  var BridgeAbi = {
13014
- _format: _format$7,
13015
- contractName: contractName$7,
13016
- sourceName: sourceName$7,
13017
- abi: abi$i,
13018
- bytecode: bytecode$i,
13019
- deployedBytecode: deployedBytecode$7,
13020
- linkReferences: linkReferences$7,
13021
- deployedLinkReferences: deployedLinkReferences$7
12650
+ _format: _format$6,
12651
+ contractName: contractName$6,
12652
+ sourceName: sourceName$6,
12653
+ abi: abi$h,
12654
+ bytecode: bytecode$h,
12655
+ deployedBytecode: deployedBytecode$6,
12656
+ linkReferences: linkReferences$6,
12657
+ deployedLinkReferences: deployedLinkReferences$6
13022
12658
  };
13023
12659
 
13024
12660
  var _DOMAIN_PREFIX = "0x191253796e6172614272696467654465706f7369740a";
@@ -13180,20 +12816,20 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13180
12816
  }
13181
12817
  var _proto = BridgeCreateOrderService.prototype;
13182
12818
  _proto.getCanonicalTokenAddress = /*#__PURE__*/function () {
13183
- var _getCanonicalTokenAddress = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(sourceChainId, sourceAsset) {
12819
+ var _getCanonicalTokenAddress = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(sourceAsset) {
13184
12820
  var canonicalTokenRegistry;
13185
12821
  return _regenerator().w(function (_context) {
13186
12822
  while (1) switch (_context.n) {
13187
12823
  case 0:
13188
- canonicalTokenRegistry = new ethers.ethers.Contract(this._darkSwapOfSourceChain.contracts.synaraCanonicalTokenRegistry, CanonicalTokenRegistryAbi.abi, this._darkSwapOfSourceChain.provider);
12824
+ canonicalTokenRegistry = new ethers.ethers.Contract(this._darkSwapOfSourceChain.contracts.synaraCanonicalTokenRegistry, CanonicalTokenRegistryAbi, this._darkSwapOfSourceChain.provider);
13189
12825
  _context.n = 1;
13190
- return canonicalTokenRegistry.getCanonicalId(BigInt(sourceChainId), sourceAsset);
12826
+ return canonicalTokenRegistry.getCanonicalId(sourceAsset);
13191
12827
  case 1:
13192
12828
  return _context.a(2, _context.v);
13193
12829
  }
13194
12830
  }, _callee, this);
13195
12831
  }));
13196
- function getCanonicalTokenAddress(_x, _x2) {
12832
+ function getCanonicalTokenAddress(_x) {
13197
12833
  return _getCanonicalTokenAddress.apply(this, arguments);
13198
12834
  }
13199
12835
  return getCanonicalTokenAddress;
@@ -13212,7 +12848,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13212
12848
  }
13213
12849
  }, _callee2, this);
13214
12850
  }));
13215
- function getBridgeFee(_x3, _x4, _x5) {
12851
+ function getBridgeFee(_x2, _x3, _x4) {
13216
12852
  return _getBridgeFee.apply(this, arguments);
13217
12853
  }
13218
12854
  return getBridgeFee;
@@ -13236,7 +12872,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13236
12872
  _t2 = _context3.v;
13237
12873
  feeRatio = _t(_t2);
13238
12874
  _context3.n = 3;
13239
- return this.getCanonicalTokenAddress(sourceChainId, sourceAsset);
12875
+ return this.getCanonicalTokenAddress(sourceAsset);
13240
12876
  case 3:
13241
12877
  canonicalIdFromContract = _context3.v;
13242
12878
  if (!(canonicalIdFromContract !== canonicalId)) {
@@ -13282,7 +12918,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13282
12918
  }
13283
12919
  }, _callee3, this);
13284
12920
  }));
13285
- function prepare(_x6, _x7, _x8, _x9, _x0, _x1, _x10, _x11, _x12, _x13, _x14, _x15) {
12921
+ function prepare(_x5, _x6, _x7, _x8, _x9, _x0, _x1, _x10, _x11, _x12, _x13, _x14) {
13286
12922
  return _prepare.apply(this, arguments);
13287
12923
  }
13288
12924
  return prepare;
@@ -13350,7 +12986,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13350
12986
  }
13351
12987
  }, _callee4, this);
13352
12988
  }));
13353
- function submitProof(_x16) {
12989
+ function submitProof(_x15) {
13354
12990
  return _submitProof.apply(this, arguments);
13355
12991
  }
13356
12992
  return submitProof;
@@ -13440,7 +13076,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13440
13076
  }
13441
13077
  }, _callee5, null, [[2, 8]]);
13442
13078
  }));
13443
- function pollJobStatus(_x17) {
13079
+ function pollJobStatus(_x16) {
13444
13080
  return _pollJobStatus.apply(this, arguments);
13445
13081
  }
13446
13082
  return pollJobStatus;
@@ -13475,7 +13111,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13475
13111
  }
13476
13112
  }, _callee6);
13477
13113
  }));
13478
- function generateProof(_x18) {
13114
+ function generateProof(_x17) {
13479
13115
  return _generateProof.apply(this, arguments);
13480
13116
  }
13481
13117
  return generateProof;
@@ -13506,7 +13142,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13506
13142
  }
13507
13143
  }, _callee7, this);
13508
13144
  }));
13509
- function computeDepositId(_x19) {
13145
+ function computeDepositId(_x18) {
13510
13146
  return _computeDepositId.apply(this, arguments);
13511
13147
  }
13512
13148
  return computeDepositId;
@@ -13528,7 +13164,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13528
13164
  }
13529
13165
  }, _callee8, this);
13530
13166
  }));
13531
- function getCurrentNonce(_x20) {
13167
+ function getCurrentNonce(_x19) {
13532
13168
  return _getCurrentNonce.apply(this, arguments);
13533
13169
  }
13534
13170
  return getCurrentNonce;
@@ -13566,7 +13202,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13566
13202
  }
13567
13203
  }, _callee9, this);
13568
13204
  }));
13569
- function composeCallData(_x21) {
13205
+ function composeCallData(_x20) {
13570
13206
  return _composeCallData.apply(this, arguments);
13571
13207
  }
13572
13208
  return composeCallData;
@@ -13608,7 +13244,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13608
13244
  }
13609
13245
  }, _callee0, this);
13610
13246
  }));
13611
- function allowance(_x22) {
13247
+ function allowance(_x21) {
13612
13248
  return _allowance.apply(this, arguments);
13613
13249
  }
13614
13250
  return allowance;
@@ -13642,7 +13278,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13642
13278
  }
13643
13279
  }, _callee1, this);
13644
13280
  }));
13645
- function execute(_x23) {
13281
+ function execute(_x22) {
13646
13282
  return _execute2.apply(this, arguments);
13647
13283
  }
13648
13284
  return execute;
@@ -13685,7 +13321,7 @@ var BridgeCreateOrderService = /*#__PURE__*/function () {
13685
13321
  }
13686
13322
  }, _callee10, this);
13687
13323
  }));
13688
- function _execute(_x24) {
13324
+ function _execute(_x23) {
13689
13325
  return _execute3.apply(this, arguments);
13690
13326
  }
13691
13327
  return _execute;
@@ -13793,6 +13429,7 @@ exports.createNote = createNote;
13793
13429
  exports.createOrderNoteExt = createOrderNoteExt;
13794
13430
  exports.deserializeDarkSwapMessage = deserializeDarkSwapMessage;
13795
13431
  exports.generateKeyPair = generateKeyPair;
13432
+ exports.getConfirmations = getConfirmations;
13796
13433
  exports.getFeeRatio = getFeeRatio;
13797
13434
  exports.getMerklePathAndRoot = getMerklePathAndRoot;
13798
13435
  exports.getNoteFooter = getNoteFooter;
@@ -13804,6 +13441,7 @@ exports.isAddressEquals = isAddressEquals;
13804
13441
  exports.isHexEquals = isHexEquals;
13805
13442
  exports.isNativeAsset = isNativeAsset;
13806
13443
  exports.isNoteActive = isNoteActive;
13444
+ exports.isNoteCreated = isNoteCreated;
13807
13445
  exports.isNoteSpent = isNoteSpent;
13808
13446
  exports.isNoteValid = isNoteValid;
13809
13447
  exports.legacyTokenConfig = legacyTokenConfig;