rango-sdk-basic 0.1.52 → 0.1.54

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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Rango Exchange SDK
2
2
 
3
- - [Basic-SDK Integration Tutorial](https://docs.rango.exchange/integration-quick-start/overview)
4
- - [Basic-SDK Reference](https://docs.rango.exchange/api-integration/rango-api/basic-api-single-tx)
3
+ - [Basic-SDK Integration Tutorial](https://docs.rango.exchange/api-integration/basic-api-single-step/tutorial/sdk-example)
4
+ - [Basic-SDK Reference](https://docs.rango.exchange/api-integration/basic-api-single-step/api-reference)
5
5
 
6
6
  ## Basic SDK (Single Step Tx)
7
7
 
@@ -20,5 +20,5 @@
20
20
 
21
21
  Please checkout the examples' folder for sample usage of the SDK. We will add more examples there soon.
22
22
 
23
- - [Documents](https://docs.rango.exchange/integration/overview)
24
- - [Examples](https://github.com/rango-exchange/rango-sdk/tree/master/examples/basic/)
23
+ - [Documents](https://docs.rango.exchange/api-integration/basic-api-single-step/tutorial/sdk-example)
24
+ - [Examples](https://github.com/rango-exchange/rango-sdk/tree/master/examples/basic)
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
6
 
7
7
  var uuid = _interopDefault(require('uuid-random'));
8
- var ethRpcErrors = require('eth-rpc-errors');
9
8
  var axios = _interopDefault(require('axios'));
10
9
 
11
10
  function asyncGeneratorStep(n, t, e, r, o, a, c) {
@@ -449,286 +448,6 @@ var isEvmTransaction = function isEvmTransaction(transaction) {
449
448
  return transaction.type === exports.TransactionType.EVM;
450
449
  };
451
450
 
452
- var MetamaskErrorCodes = {
453
- rpc: {
454
- invalidInput: -32000,
455
- resourceNotFound: -32001,
456
- resourceUnavailable: -32002,
457
- transactionRejected: -32003,
458
- methodNotSupported: -32004,
459
- limitExceeded: -32005,
460
- parse: -32700,
461
- invalidRequest: -32600,
462
- methodNotFound: -32601,
463
- invalidParams: -32602,
464
- internal: -32603
465
- },
466
- provider: {
467
- userRejectedRequest: 4001,
468
- unauthorized: 4100,
469
- unsupportedMethod: 4200,
470
- disconnected: 4900,
471
- chainDisconnected: 4901
472
- }
473
- };
474
-
475
- function sleep(ms) {
476
- return new Promise(function (resolve) {
477
- return setTimeout(resolve, ms);
478
- });
479
- }
480
-
481
- function prepareEvmTransaction(evmTx, isApprove) {
482
- var gasPrice = !!evmTx.gasPrice && !evmTx.gasPrice.startsWith('0x') ? '0x' + parseInt(evmTx.gasPrice).toString(16) : null;
483
- var manipulatedTx = _extends({}, evmTx, {
484
- gasPrice: gasPrice
485
- });
486
- var tx = {};
487
- if (!!manipulatedTx.from) tx = _extends({}, tx, {
488
- from: manipulatedTx.from
489
- });
490
- if (isApprove) {
491
- if (!!manipulatedTx.approveTo) tx = _extends({}, tx, {
492
- to: manipulatedTx.approveTo
493
- });
494
- if (!!manipulatedTx.approveData) tx = _extends({}, tx, {
495
- data: manipulatedTx.approveData
496
- });
497
- } else {
498
- if (!!manipulatedTx.txTo) tx = _extends({}, tx, {
499
- to: manipulatedTx.txTo
500
- });
501
- if (!!manipulatedTx.txData) tx = _extends({}, tx, {
502
- data: manipulatedTx.txData
503
- });
504
- if (!!manipulatedTx.value) tx = _extends({}, tx, {
505
- value: manipulatedTx.value
506
- });
507
- if (!!manipulatedTx.gasLimit) tx = _extends({}, tx, {
508
- gasLimit: manipulatedTx.gasLimit
509
- });
510
- if (!!manipulatedTx.gasPrice) tx = _extends({}, tx, {
511
- gasPrice: manipulatedTx.gasPrice
512
- });
513
- }
514
- return tx;
515
- }
516
- function checkApprovalSync(_x, _x2, _x3) {
517
- return _checkApprovalSync.apply(this, arguments);
518
- }
519
- function _checkApprovalSync() {
520
- _checkApprovalSync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(requestId, txId, rangoClient) {
521
- var approvalResponse;
522
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
523
- while (1) switch (_context3.prev = _context3.next) {
524
- case 0:
525
- _context3.prev = 1;
526
- _context3.next = 4;
527
- return rangoClient.isApproved(requestId, txId);
528
- case 4:
529
- approvalResponse = _context3.sent;
530
- if (!(approvalResponse != null && approvalResponse.isApproved)) {
531
- _context3.next = 7;
532
- break;
533
- }
534
- return _context3.abrupt("return", true);
535
- case 7:
536
- if (!(!(approvalResponse != null && approvalResponse.isApproved) && (approvalResponse == null ? void 0 : approvalResponse.txStatus) === exports.TransactionStatus.FAILED)) {
537
- _context3.next = 9;
538
- break;
539
- }
540
- return _context3.abrupt("return", false);
541
- case 9:
542
- _context3.next = 14;
543
- break;
544
- case 11:
545
- _context3.prev = 11;
546
- _context3.t0 = _context3["catch"](1);
547
- console.log('ignorinig error', {
548
- err: _context3.t0
549
- });
550
- case 14:
551
- _context3.next = 16;
552
- return sleep(3000);
553
- case 16:
554
- _context3.next = 0;
555
- break;
556
- case 18:
557
- case "end":
558
- return _context3.stop();
559
- }
560
- }, _callee3, null, [[1, 11]]);
561
- }));
562
- return _checkApprovalSync.apply(this, arguments);
563
- }
564
- var checkTransactionStatusSync = /*#__PURE__*/function () {
565
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(requestId, txId, rangoClient) {
566
- var txStatus;
567
- return _regeneratorRuntime().wrap(function _callee$(_context) {
568
- while (1) switch (_context.prev = _context.next) {
569
- case 0:
570
- _context.prev = 1;
571
- _context.next = 4;
572
- return rangoClient.status({
573
- requestId: requestId,
574
- txId: txId
575
- });
576
- case 4:
577
- txStatus = _context.sent;
578
- _context.next = 10;
579
- break;
580
- case 7:
581
- _context.prev = 7;
582
- _context.t0 = _context["catch"](1);
583
- console.log('ignorinig error', {
584
- err: _context.t0
585
- });
586
- case 10:
587
- if (!txStatus) {
588
- _context.next = 13;
589
- break;
590
- }
591
- if (!(!!txStatus.status && [exports.TransactionStatus.FAILED, exports.TransactionStatus.SUCCESS].includes(txStatus.status))) {
592
- _context.next = 13;
593
- break;
594
- }
595
- return _context.abrupt("return", txStatus);
596
- case 13:
597
- _context.next = 15;
598
- return sleep(3000);
599
- case 15:
600
- _context.next = 0;
601
- break;
602
- case 17:
603
- case "end":
604
- return _context.stop();
605
- }
606
- }, _callee, null, [[1, 7]]);
607
- }));
608
- return function checkTransactionStatusSync(_x4, _x5, _x6) {
609
- return _ref.apply(this, arguments);
610
- };
611
- }();
612
- var executeEvmRoute = /*#__PURE__*/function () {
613
- var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(client, signer, route) {
614
- var tx, requestId, error, resultType, evmTransaction, txChainId, signerChainId, approveTxData, approveTx, isApproved, mainTxData, mainTx, status;
615
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
616
- while (1) switch (_context2.prev = _context2.next) {
617
- case 0:
618
- tx = route.tx, requestId = route.requestId, error = route.error, resultType = route.resultType;
619
- if (!(resultType != 'OK')) {
620
- _context2.next = 3;
621
- break;
622
- }
623
- throw new Error(resultType);
624
- case 3:
625
- if (!(!!error || !tx)) {
626
- _context2.next = 5;
627
- break;
628
- }
629
- throw new Error(error || 'Error creating the transaction.');
630
- case 5:
631
- if (!((tx == null ? void 0 : tx.type) !== exports.TransactionType.EVM)) {
632
- _context2.next = 7;
633
- break;
634
- }
635
- throw new Error('Non Evm transactions are not supported yet.');
636
- case 7:
637
- evmTransaction = tx;
638
- if (evmTransaction) {
639
- _context2.next = 10;
640
- break;
641
- }
642
- throw new Error('Transaction is null. Please try again!');
643
- case 10:
644
- txChainId = parseInt(evmTransaction.blockChain.chainId || '-1');
645
- _context2.next = 13;
646
- return signer.getChainId();
647
- case 13:
648
- signerChainId = _context2.sent;
649
- if (!(signerChainId !== txChainId)) {
650
- _context2.next = 16;
651
- break;
652
- }
653
- throw new Error("Signer chainId " + signerChainId + " doesn't match required chainId " + txChainId + ".");
654
- case 16:
655
- if (!(!!evmTransaction.approveTo && !!evmTransaction.approveData)) {
656
- _context2.next = 27;
657
- break;
658
- }
659
- approveTxData = prepareEvmTransaction(evmTransaction, true);
660
- _context2.next = 20;
661
- return signer.sendTransaction(approveTxData);
662
- case 20:
663
- approveTx = _context2.sent;
664
- approveTx.wait();
665
- _context2.next = 24;
666
- return checkApprovalSync(requestId, approveTx.hash, client);
667
- case 24:
668
- isApproved = _context2.sent;
669
- if (isApproved) {
670
- _context2.next = 27;
671
- break;
672
- }
673
- throw new Error('Error in approve transaction.');
674
- case 27:
675
- _context2.next = 29;
676
- return signer.getChainId();
677
- case 29:
678
- signerChainId = _context2.sent;
679
- if (!(signerChainId !== txChainId)) {
680
- _context2.next = 32;
681
- break;
682
- }
683
- throw new Error("Signer chainId " + signerChainId + " doesn't match required chainId " + txChainId + ".");
684
- case 32:
685
- mainTxData = prepareEvmTransaction(evmTransaction, false);
686
- _context2.next = 35;
687
- return signer.sendTransaction(mainTxData);
688
- case 35:
689
- mainTx = _context2.sent;
690
- mainTx.wait();
691
- _context2.next = 39;
692
- return checkTransactionStatusSync(requestId, mainTx.hash, client);
693
- case 39:
694
- status = _context2.sent;
695
- if (!(status.status !== exports.TransactionStatus.SUCCESS)) {
696
- _context2.next = 42;
697
- break;
698
- }
699
- throw new Error("Cross-chain swap failed. " + (status.error || ''));
700
- case 42:
701
- return _context2.abrupt("return", status);
702
- case 43:
703
- case "end":
704
- return _context2.stop();
705
- }
706
- }, _callee2);
707
- }));
708
- return function executeEvmRoute(_x7, _x8, _x9) {
709
- return _ref2.apply(this, arguments);
710
- };
711
- }();
712
-
713
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
714
- var prettifyError = function prettifyError(error) {
715
- if (!error) return error;
716
- if (error.code && (error.code === 'ACTION_REJECTED' || error.code === 4001)) return new Error('Transaction Rejected');
717
- if (error && typeof error.code === 'number') {
718
- if (Object.values(MetamaskErrorCodes.provider).includes(error.code)) {
719
- return new Error(ethRpcErrors.getMessageFromCode(error.code));
720
- }
721
- if (Object.values(MetamaskErrorCodes.rpc).includes(error.code)) {
722
- var _error$message, _error$message2, _error$message3;
723
- if (error.code === MetamaskErrorCodes.rpc.internal && (_error$message = error.message) != null && _error$message.includes('underpriced')) return new Error('Transaction underpriced');
724
- if ((_error$message2 = error.message) != null && _error$message2.includes('intrinsic gas too low') || (_error$message3 = error.message) != null && _error$message3.includes('out of gas')) return new Error('This Gas limit is low.');
725
- return new Error(ethRpcErrors.getMessageFromCode(error.code));
726
- }
727
- }
728
- if (error.message) return new Error(error.message);
729
- return error;
730
- };
731
-
732
451
  var RangoClient = /*#__PURE__*/function () {
733
452
  function RangoClient(apiKey, debug, apiUrl) {
734
453
  if (debug === void 0) {
@@ -1089,57 +808,16 @@ var RangoClient = /*#__PURE__*/function () {
1089
808
  }
1090
809
  return tokenBalance;
1091
810
  }();
1092
- _proto.executeEvmRoute = /*#__PURE__*/function () {
1093
- var _executeEvmRoute2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(
1094
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1095
- signer, route) {
1096
- var prettifiedError, message;
1097
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1098
- while (1) switch (_context13.prev = _context13.next) {
1099
- case 0:
1100
- _context13.prev = 0;
1101
- _context13.next = 3;
1102
- return executeEvmRoute(this, signer, route);
1103
- case 3:
1104
- return _context13.abrupt("return", _context13.sent);
1105
- case 6:
1106
- _context13.prev = 6;
1107
- _context13.t0 = _context13["catch"](0);
1108
- prettifiedError = prettifyError(_context13.t0);
1109
- try {
1110
- message = (prettifiedError == null ? void 0 : prettifiedError.message) || 'Error executing the route';
1111
- this.reportFailure({
1112
- requestId: route.requestId,
1113
- eventType: 'TX_FAIL',
1114
- reason: message
1115
- });
1116
- } catch (err) {
1117
- console.log({
1118
- err: err
1119
- });
1120
- }
1121
- throw prettifiedError;
1122
- case 11:
1123
- case "end":
1124
- return _context13.stop();
1125
- }
1126
- }, _callee13, this, [[0, 6]]);
1127
- }));
1128
- function executeEvmRoute$1(_x23, _x24) {
1129
- return _executeEvmRoute2.apply(this, arguments);
1130
- }
1131
- return executeEvmRoute$1;
1132
- }();
1133
811
  _proto.connectedAssets = /*#__PURE__*/function () {
1134
- var _connectedAssets = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(connectedAssetsRequest, options) {
812
+ var _connectedAssets = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(connectedAssetsRequest, options) {
1135
813
  var body, axiosResponse;
1136
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1137
- while (1) switch (_context14.prev = _context14.next) {
814
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
815
+ while (1) switch (_context13.prev = _context13.next) {
1138
816
  case 0:
1139
817
  body = {
1140
818
  from: assetToString(connectedAssetsRequest.from)
1141
819
  };
1142
- _context14.next = 3;
820
+ _context13.next = 3;
1143
821
  return this.httpService.get("/basic/connected-assets?apiKey=" + this.apiKey, _extends({
1144
822
  params: body,
1145
823
  headers: {
@@ -1147,15 +825,15 @@ var RangoClient = /*#__PURE__*/function () {
1147
825
  }
1148
826
  }, options));
1149
827
  case 3:
1150
- axiosResponse = _context14.sent;
1151
- return _context14.abrupt("return", axiosResponse.data);
828
+ axiosResponse = _context13.sent;
829
+ return _context13.abrupt("return", axiosResponse.data);
1152
830
  case 5:
1153
831
  case "end":
1154
- return _context14.stop();
832
+ return _context13.stop();
1155
833
  }
1156
- }, _callee14, this);
834
+ }, _callee13, this);
1157
835
  }));
1158
- function connectedAssets(_x25, _x26) {
836
+ function connectedAssets(_x23, _x24) {
1159
837
  return _connectedAssets.apply(this, arguments);
1160
838
  }
1161
839
  return connectedAssets;
@@ -1163,7 +841,6 @@ var RangoClient = /*#__PURE__*/function () {
1163
841
  return RangoClient;
1164
842
  }();
1165
843
 
1166
- exports.MetamaskErrorCodes = MetamaskErrorCodes;
1167
844
  exports.RangoClient = RangoClient;
1168
845
  exports.assetToString = assetToString;
1169
846
  exports.cosmosBlockchains = cosmosBlockchains;
@@ -1 +1 @@
1
- {"version":3,"file":"rango-sdk-basic.cjs.development.js","sources":["../src/types/api/common.ts","../../../node_modules/rango-types/src/api/shared/type-gaurds.ts","../../../node_modules/rango-types/src/api/shared/routing.ts","../../../node_modules/rango-types/src/api/shared/transactions.ts","../../../node_modules/rango-types/src/api/shared/txs/ton.ts","../src/types/utils/errors.ts","../src/utils/promise.ts","../src/services/executor.ts","../src/utils/errors.ts","../src/services/client.ts"],"sourcesContent":["import { Asset } from 'rango-types/lib/api/basic'\nexport * from 'rango-types/lib/api/basic/common'\n\nexport function assetToString(asset: Asset): string {\n if (!!asset.address)\n return `${asset.blockchain}.${asset.symbol}--${asset.address}`\n else return `${asset.blockchain}.${asset.symbol}`\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n} from './meta.js'\n\nexport const isEvmBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is EvmBlockchainMeta => blockchainMeta.type === 'EVM'\n\nexport const isCosmosBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is CosmosBlockchainMeta => blockchainMeta.type === 'COSMOS'\n\nexport const isSolanaBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is SolanaBlockchainMeta => blockchainMeta.type === 'SOLANA'\n\nexport const isTronBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TronBlockchainMeta => blockchainMeta.type === 'TRON'\n\nexport const isTransferBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TransferBlockchainMeta =>\n blockchainMeta.type === 'TRANSFER'\n\nexport const isStarknetBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is StarkNetBlockchainMeta =>\n blockchainMeta.type === 'STARKNET'\n\nexport const isTonBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TonBlockchainMeta => blockchainMeta.type === 'TON'\n\nexport const evmBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isEvmBlockchain)\n\nexport const solanaBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isSolanaBlockchain)\n\nexport const starknetBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isStarknetBlockchain)\n\nexport const tronBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTronBlockchain)\n\nexport const cosmosBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isCosmosBlockchain)\n\nexport const transferBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTransferBlockchain)\n\nexport const tonBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTonBlockchain)\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport enum TonChainID {\n MAINNET = '-239',\n TESTNET = '-3',\n}\n\n/**\n * @property {string} address - Receiver's address\n * @property {string} amount - Amount to send in nanoTon\n * @property {string} [stateInit] - Contract specific data to add to the transaction\n * @property {string} [payload] - Contract specific data to add to the transaction\n */\nexport interface TonMessage {\n address: string\n amount: string\n stateInit?: string\n payload?: string\n}\n\n/**\n * This type of transaction is used for all Ton transactions\n *\n * @property {TransactionType} type - This field equals to TON for all Ton transactions\n * @property {number} validUntil - Sending transaction deadline in unix epoch seconds\n * @property {TonChainID} [network] - The network (mainnet or testnet) where DApp intends to send the transaction. If not set, the transaction is sent to the network currently set in the wallet, but this is not safe and DApp should always strive to set the network. If the network parameter is set, but the wallet has a different network set, the wallet should show an alert and DO NOT ALLOW TO SEND this transaction\n * @property {string} [from] - The sender address in '<wc>:<hex>' format from which DApp intends to send the transaction. Current account.address by default\n * @property {TonMessage[]} messages - Messages to send: min is 1, max is 4\n */\nexport interface TonTransaction extends BaseTransaction {\n type: TransactionType.TON\n validUntil: number\n network?: TonChainID\n from?: string\n messages: TonMessage[]\n}\n\nexport const isTonTransaction = (transaction: {\n type: TransactionType\n}): transaction is TonTransaction => transaction.type === TransactionType.TON\n","export const MetamaskErrorCodes = {\n rpc: {\n invalidInput: -32000,\n resourceNotFound: -32001,\n resourceUnavailable: -32002,\n transactionRejected: -32003,\n methodNotSupported: -32004,\n limitExceeded: -32005,\n parse: -32700,\n invalidRequest: -32600,\n methodNotFound: -32601,\n invalidParams: -32602,\n internal: -32603,\n },\n provider: {\n userRejectedRequest: 4001,\n unauthorized: 4100,\n unsupportedMethod: 4200,\n disconnected: 4900,\n chainDisconnected: 4901,\n },\n}\n","export function sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms))\n}\n","import { Signer } from 'ethers'\nimport { RangoClient } from './client'\nimport { EvmTransaction } from '../types/api/txs'\nimport {\n StatusResponse,\n SwapResponse,\n TransactionStatus,\n TransactionType,\n} from '../types/api/transactions'\nimport { sleep } from '../utils/promise'\n\nexport function prepareEvmTransaction(\n evmTx: EvmTransaction,\n isApprove: boolean\n) {\n const gasPrice =\n !!evmTx.gasPrice && !evmTx.gasPrice.startsWith('0x')\n ? '0x' + parseInt(evmTx.gasPrice).toString(16)\n : null\n const manipulatedTx = {\n ...evmTx,\n gasPrice,\n }\n let tx = {}\n if (!!manipulatedTx.from) tx = { ...tx, from: manipulatedTx.from }\n if (isApprove) {\n if (!!manipulatedTx.approveTo) tx = { ...tx, to: manipulatedTx.approveTo }\n if (!!manipulatedTx.approveData)\n tx = { ...tx, data: manipulatedTx.approveData }\n } else {\n if (!!manipulatedTx.txTo) tx = { ...tx, to: manipulatedTx.txTo }\n if (!!manipulatedTx.txData) tx = { ...tx, data: manipulatedTx.txData }\n if (!!manipulatedTx.value) tx = { ...tx, value: manipulatedTx.value }\n if (!!manipulatedTx.gasLimit)\n tx = { ...tx, gasLimit: manipulatedTx.gasLimit }\n if (!!manipulatedTx.gasPrice)\n tx = { ...tx, gasPrice: manipulatedTx.gasPrice }\n }\n return tx\n}\n\nasync function checkApprovalSync(\n requestId: string,\n txId: string,\n rangoClient: RangoClient\n): Promise<boolean> {\n while (true) {\n try {\n const approvalResponse = await rangoClient.isApproved(requestId, txId)\n if (approvalResponse?.isApproved) return true\n if (\n !approvalResponse?.isApproved &&\n approvalResponse?.txStatus === TransactionStatus.FAILED\n )\n return false\n } catch (err) {\n console.log('ignorinig error', { err })\n }\n await sleep(3_000)\n }\n}\n\nexport const checkTransactionStatusSync = async (\n requestId: string,\n txId: string,\n rangoClient: RangoClient\n) => {\n let txStatus: StatusResponse | undefined\n while (true) {\n try {\n txStatus = await rangoClient.status({\n requestId,\n txId,\n })\n } catch (err) {\n console.log('ignorinig error', { err })\n }\n if (!!txStatus) {\n if (\n !!txStatus.status &&\n [TransactionStatus.FAILED, TransactionStatus.SUCCESS].includes(\n txStatus.status\n )\n ) {\n return txStatus\n }\n }\n await sleep(3_000)\n }\n}\n\nexport const executeEvmRoute = async (\n client: RangoClient,\n signer: Signer,\n route: SwapResponse\n): Promise<StatusResponse> => {\n const { tx, requestId, error, resultType } = route\n if (resultType != 'OK') throw new Error(resultType)\n if (!!error || !tx)\n throw new Error(error || 'Error creating the transaction.')\n if (tx?.type !== TransactionType.EVM)\n throw new Error('Non Evm transactions are not supported yet.')\n const evmTransaction = tx as EvmTransaction\n if (!evmTransaction) throw new Error('Transaction is null. Please try again!')\n const txChainId = parseInt(evmTransaction.blockChain.chainId || '-1')\n let signerChainId = await signer.getChainId()\n if (signerChainId !== txChainId) {\n throw new Error(\n `Signer chainId ${signerChainId} doesn't match required chainId ${txChainId}.`\n )\n }\n if (!!evmTransaction.approveTo && !!evmTransaction.approveData) {\n const approveTxData = prepareEvmTransaction(evmTransaction, true)\n const approveTx = await signer.sendTransaction(approveTxData)\n approveTx.wait()\n const isApproved = await checkApprovalSync(\n requestId,\n approveTx.hash,\n client\n )\n if (!isApproved) throw new Error('Error in approve transaction.')\n }\n signerChainId = await signer.getChainId()\n if (signerChainId !== txChainId) {\n throw new Error(\n `Signer chainId ${signerChainId} doesn't match required chainId ${txChainId}.`\n )\n }\n const mainTxData = prepareEvmTransaction(evmTransaction, false)\n const mainTx = await signer.sendTransaction(mainTxData)\n mainTx.wait()\n const status = await checkTransactionStatusSync(\n requestId,\n mainTx.hash,\n client\n )\n if (status.status !== TransactionStatus.SUCCESS)\n throw new Error(`Cross-chain swap failed. ${status.error || ''}`)\n return status\n}\n","import { getMessageFromCode } from 'eth-rpc-errors'\nimport { MetamaskErrorCodes } from '../types/utils/errors'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const prettifyError = (error: any) => {\n if (!error) return error\n if (error.code && (error.code === 'ACTION_REJECTED' || error.code === 4001))\n return new Error('Transaction Rejected')\n if (error && typeof error.code === 'number') {\n if (Object.values(MetamaskErrorCodes.provider).includes(error.code)) {\n return new Error(getMessageFromCode(error.code))\n }\n if (Object.values(MetamaskErrorCodes.rpc).includes(error.code)) {\n if (\n error.code === MetamaskErrorCodes.rpc.internal &&\n error.message?.includes('underpriced')\n )\n return new Error('Transaction underpriced')\n if (\n error.message?.includes('intrinsic gas too low') ||\n error.message?.includes('out of gas')\n )\n return new Error('This Gas limit is low.')\n return new Error(getMessageFromCode(error.code))\n }\n }\n if (error.message) return new Error(error.message)\n return error\n}\n","import uuid from 'uuid-random'\n\nimport {\n MetaRequest,\n MetaResponse,\n QuoteRequest,\n QuoteResponse,\n CheckApprovalResponse,\n StatusRequest,\n StatusResponse,\n SwapRequest,\n SwapResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n assetToString,\n BlockchainMeta,\n RequestOptions,\n MessagingProtocolsResponse,\n SwapperMetaExtended,\n ConnectedAssetsResponse,\n ConnectedAssetsRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceRequest,\n TokenBalanceResponse,\n} from '../types'\nimport { Signer } from 'ethers'\nimport { executeEvmRoute as executeEvmRoute } from './executor'\nimport { prettifyError } from '../utils/errors'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddress = { blockchain: string; address: string }\n\nexport class RangoClient {\n private readonly deviceId: string\n private readonly apiKey: string\n private readonly apiUrl: string\n private readonly httpService: AxiosInstance\n\n constructor(apiKey: string, debug = false, apiUrl?: string) {\n this.apiUrl = apiUrl || 'https://api.rango.exchange'\n this.apiKey = apiKey\n try {\n if (typeof window !== 'undefined') {\n const deviceId = localStorage.getItem('deviceId')\n if (deviceId) {\n this.deviceId = deviceId\n } else {\n const generatedId = uuid()\n localStorage.setItem('deviceId', generatedId)\n this.deviceId = generatedId\n }\n } else {\n this.deviceId = uuid()\n }\n } catch (e) {\n this.deviceId = uuid()\n }\n this.httpService = axios.create({\n baseURL: this.apiUrl,\n })\n if (debug) {\n this.httpService.interceptors.request.use((request) => {\n console.log('Starting Request', JSON.stringify(request, null, 2))\n return request\n })\n this.httpService.interceptors.response.use((response) => {\n console.log('Response:', JSON.stringify(response, null, 2))\n return response\n })\n }\n }\n\n public async meta(\n metaRequest?: MetaRequest,\n options?: RequestOptions\n ): Promise<MetaResponse> {\n const params = {\n ...metaRequest,\n blockchains: metaRequest?.blockchains?.join(),\n swappers: metaRequest?.swappers?.join(),\n swappersGroups: metaRequest?.swappersGroups?.join(),\n transactionTypes: metaRequest?.transactionTypes?.join(),\n }\n const axiosResponse = await this.httpService.get<MetaResponse>(\n `/basic/meta?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async chains(options?: RequestOptions): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/basic/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async swappers(options?: RequestOptions): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/basic/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async messagingProtocols(\n options?: RequestOptions\n ): Promise<MessagingProtocolsResponse> {\n const axiosResponse =\n await this.httpService.get<MessagingProtocolsResponse>(\n `/basic/meta/messaging-protocols?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n\n public async token(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/basic/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async quote(\n quoteRequest: QuoteRequest,\n options?: RequestOptions\n ): Promise<QuoteResponse> {\n const body = {\n ...quoteRequest,\n from: assetToString(quoteRequest.from),\n to: assetToString(quoteRequest.to),\n swappers:\n !!quoteRequest.swappers && quoteRequest.swappers.length > 0\n ? quoteRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!quoteRequest.swapperGroups && quoteRequest.swapperGroups.length > 0\n ? quoteRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!quoteRequest.messagingProtocols &&\n quoteRequest.messagingProtocols.length > 0\n ? quoteRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<QuoteResponse>(\n `/basic/quote?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async isApproved(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/basic/is-approved?apiKey=${this.apiKey}`,\n {\n params: { requestId, txId },\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async status(\n statusRequest: StatusRequest,\n options?: RequestOptions\n ): Promise<StatusResponse> {\n const axiosResponse = await this.httpService.get<StatusResponse>(\n `/basic/status?apiKey=${this.apiKey}`,\n {\n params: statusRequest,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async swap(\n swapRequest: SwapRequest,\n options?: RequestOptions\n ): Promise<SwapResponse> {\n const body = {\n ...swapRequest,\n from: assetToString(swapRequest.from),\n to: assetToString(swapRequest.to),\n referrerAddress: swapRequest.referrerAddress || null,\n referrerFee: swapRequest.referrerFee || null,\n disableEstimate: swapRequest.disableEstimate || false,\n swappers:\n !!swapRequest.swappers && swapRequest.swappers.length > 0\n ? swapRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!swapRequest.swapperGroups && swapRequest.swapperGroups.length > 0\n ? swapRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!swapRequest.messagingProtocols &&\n swapRequest.messagingProtocols.length > 0\n ? swapRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<SwapResponse>(\n `/basic/swap?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async reportFailure(\n requestBody: ReportTransactionRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.httpService.post(\n `/basic/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n }\n\n public async balance(\n walletAddress: WalletAddress,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/basic/balance?apiKey=${this.apiKey}`,\n {\n params: walletAddress,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async tokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/basic/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async executeEvmRoute(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n signer: any,\n route: SwapResponse\n ): Promise<StatusResponse> {\n try {\n return await executeEvmRoute(this, signer as Signer, route)\n } catch (error) {\n const prettifiedError = prettifyError(error)\n try {\n const message = prettifiedError?.message || 'Error executing the route'\n this.reportFailure({\n requestId: route.requestId,\n eventType: 'TX_FAIL',\n reason: message,\n })\n } catch (err) {\n console.log({ err })\n }\n throw prettifiedError\n }\n }\n\n public async connectedAssets(\n connectedAssetsRequest: ConnectedAssetsRequest,\n options?: RequestOptions\n ): Promise<ConnectedAssetsResponse> {\n const body = {\n from: assetToString(connectedAssetsRequest.from),\n }\n\n const axiosResponse = await this.httpService.get<ConnectedAssetsResponse>(\n `/basic/connected-assets?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n}\n"],"names":["assetToString","asset","address","blockchain","symbol","isEvmBlockchain","blockchainMeta","MetamaskErrorCodes","rpc","invalidInput","resourceNotFound","resourceUnavailable","transactionRejected","methodNotSupported","limitExceeded","parse","invalidRequest","methodNotFound","invalidParams","internal","provider","userRejectedRequest","unauthorized","unsupportedMethod","disconnected","chainDisconnected","sleep","ms","Promise","resolve","setTimeout","prepareEvmTransaction","evmTx","isApprove","gasPrice","startsWith","parseInt","toString","manipulatedTx","_extends","tx","from","approveTo","to","approveData","data","txTo","txData","value","gasLimit","checkApprovalSync","_x","_x2","_x3","_checkApprovalSync","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee3","requestId","txId","rangoClient","approvalResponse","wrap","_callee3$","_context3","prev","next","isApproved","sent","abrupt","txStatus","TransactionStatus","FAILED","t0","console","log","err","stop","checkTransactionStatusSync","_ref","_callee","_callee$","_context","status","SUCCESS","includes","_x4","_x5","_x6","executeEvmRoute","_ref2","_callee2","client","signer","route","error","resultType","evmTransaction","txChainId","signerChainId","approveTxData","approveTx","mainTxData","mainTx","_callee2$","_context2","Error","type","TransactionType","EVM","blockChain","chainId","getChainId","sendTransaction","wait","hash","_x7","_x8","_x9","prettifyError","code","Object","values","getMessageFromCode","_error$message","_error$message2","_error$message3","message","RangoClient","apiKey","debug","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","interceptors","request","use","JSON","stringify","response","_proto","prototype","meta","_meta","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","blockchains","join","swappers","swappersGroups","transactionTypes","get","chains","_chains","_swappers","messagingProtocols","_messagingProtocols","_callee4","_callee4$","_context4","token","_token","_callee5","customTokenRequest","_callee5$","_context5","quote","_quote","_callee6","quoteRequest","body","_callee6$","_context6","length","undefined","swapperGroups","headers","_isApproved","_callee7","_callee7$","_context7","_x10","_x11","_x12","_status","_callee8","statusRequest","_callee8$","_context8","_x13","_x14","swap","_swap","_callee9","swapRequest","_callee9$","_context9","referrerAddress","referrerFee","disableEstimate","_x15","_x16","reportFailure","_reportFailure","_callee10","requestBody","_callee10$","_context10","post","_x17","_x18","balance","_balance","_callee11","walletAddress","_callee11$","_context11","_x19","_x20","tokenBalance","_tokenBalance","_callee12","tokenBalanceRequest","_callee12$","_context12","_x21","_x22","_executeEvmRoute2","_callee13","prettifiedError","_callee13$","_context13","eventType","reason","_x23","_x24","connectedAssets","_connectedAssets","_callee14","connectedAssetsRequest","_callee14$","_context14","_x25","_x26"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,IAAA;MAAA,OAAAR,iBAAA,CAAA/L,KAAA,OAAAC,SAAA;;IAAA,OAAAoC,iBAAA;;EAAA6D,MAAA,CAEYsG,eAAe;IAAA,IAAAC,gBAAA,gBAAAvM,iBAAA,eAAAC,mBAAA,GAAAC,IAAA,CAArB,SAAAsM,UACLC,sBAA8C,EAC9CpG,OAAwB;MAAA,IAAA+B,IAAA,EAAAzB,aAAA;MAAA,OAAA1G,mBAAA,GAAAO,IAAA,UAAAkM,WAAAC,UAAA;QAAA,kBAAAA,UAAA,CAAAhM,IAAA,GAAAgM,UAAA,CAAA/L,IAAA;UAAA;YAElBwH,IAAI,GAAG;cACXpJ,IAAI,EAAEzC,aAAa,CAACkQ,sBAAsB,CAACzN,IAAI;aAChD;YAAA2N,UAAA,CAAA/L,IAAA;YAAA,OAE2B,IAAI,CAAC0E,WAAW,CAAC2B,GAAG,qCACZ,IAAI,CAACtC,MAAM,EAAA7F,QAAA;cAE3C4H,MAAM,EAAE0B,IAAI;cACZM,OAAO,EAAE;gBAAE,YAAY,EAAE,IAAI,CAAC3D;;eAC3BsB,OAAO,CACX,CACF;UAAA;YAPKM,aAAa,GAAAgG,UAAA,CAAA7L,IAAA;YAAA,OAAA6L,UAAA,CAAA5L,MAAA,WAQZ4F,aAAa,CAACvH,IAAI;UAAA;UAAA;YAAA,OAAAuN,UAAA,CAAApL,IAAA;;SAAAiL,SAAA;KAC1B;IAAA,SAAAF,gBAAAM,IAAA,EAAAC,IAAA;MAAA,OAAAN,gBAAA,CAAAzM,KAAA,OAAAC,SAAA;;IAAA,OAAAuM,eAAA;;EAAA,OAAA5H,WAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rango-sdk-basic.cjs.development.js","sources":["../src/types/api/common.ts","../../../node_modules/rango-types/src/api/shared/type-gaurds.ts","../../../node_modules/rango-types/src/api/shared/routing.ts","../../../node_modules/rango-types/src/api/shared/transactions.ts","../../../node_modules/rango-types/src/api/shared/txs/ton.ts","../src/services/client.ts"],"sourcesContent":["import { Asset } from 'rango-types/lib/api/basic'\nexport * from 'rango-types/lib/api/basic/common'\n\nexport function assetToString(asset: Asset): string {\n if (!!asset.address)\n return `${asset.blockchain}.${asset.symbol}--${asset.address}`\n else return `${asset.blockchain}.${asset.symbol}`\n}\n","import {\n BlockchainMeta,\n CosmosBlockchainMeta,\n EvmBlockchainMeta,\n SolanaBlockchainMeta,\n StarkNetBlockchainMeta,\n TonBlockchainMeta,\n TransferBlockchainMeta,\n TronBlockchainMeta,\n} from './meta.js'\n\nexport const isEvmBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is EvmBlockchainMeta => blockchainMeta.type === 'EVM'\n\nexport const isCosmosBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is CosmosBlockchainMeta => blockchainMeta.type === 'COSMOS'\n\nexport const isSolanaBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is SolanaBlockchainMeta => blockchainMeta.type === 'SOLANA'\n\nexport const isTronBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TronBlockchainMeta => blockchainMeta.type === 'TRON'\n\nexport const isTransferBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TransferBlockchainMeta =>\n blockchainMeta.type === 'TRANSFER'\n\nexport const isStarknetBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is StarkNetBlockchainMeta =>\n blockchainMeta.type === 'STARKNET'\n\nexport const isTonBlockchain = (\n blockchainMeta: BlockchainMeta\n): blockchainMeta is TonBlockchainMeta => blockchainMeta.type === 'TON'\n\nexport const evmBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isEvmBlockchain)\n\nexport const solanaBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isSolanaBlockchain)\n\nexport const starknetBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isStarknetBlockchain)\n\nexport const tronBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTronBlockchain)\n\nexport const cosmosBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isCosmosBlockchain)\n\nexport const transferBlockchains = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTransferBlockchain)\n\nexport const tonBlockchain = (blockchains: BlockchainMeta[]) =>\n blockchains.filter(isTonBlockchain)\n","/**\n * Routing Result Type\n *\n */\nexport enum RoutingResultType {\n OK = 'OK',\n HIGH_IMPACT = 'HIGH_IMPACT',\n NO_ROUTE = 'NO_ROUTE',\n INPUT_LIMIT_ISSUE = 'INPUT_LIMIT_ISSUE',\n HIGH_IMPACT_FOR_CREATE_TX = 'HIGH_IMPACT_FOR_CREATE_TX',\n}\n","/**\n * The type of transaction\n */\nexport enum TransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n TRON = 'TRON',\n STARKNET = 'STARKNET',\n TON = 'TON',\n}\n\n/**\n * The type of transaction\n * @deprecated use TransactionType instead\n */\nexport enum GenericTransactionType {\n EVM = 'EVM',\n TRANSFER = 'TRANSFER',\n COSMOS = 'COSMOS',\n SOLANA = 'SOLANA',\n}\n\n/**\n * A transaction's url that can be displayed to advanced user to track the progress\n *\n * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...\n * @property {string | null} description - A custom display name to help user distinguish the transactions from each\n * other. Example: Inbound, Outbound, Bridge, or null\n *\n */\nexport type SwapExplorerUrl = {\n description: string | null\n url: string\n}\n\n/**\n * APIErrorCode\n *\n * Error code of a swap failure\n *\n */\nexport type APIErrorCode =\n | 'TX_FAIL'\n | 'TX_EXPIRED'\n | 'FETCH_TX_FAILED'\n | 'USER_REJECT'\n | 'USER_CANCEL'\n | 'USER_CANCELED_TX'\n | 'CALL_WALLET_FAILED'\n | 'SEND_TX_FAILED'\n | 'CALL_OR_SEND_FAILED'\n | 'TX_FAILED_IN_BLOCKCHAIN'\n | 'CLIENT_UNEXPECTED_BEHAVIOUR'\n | 'INSUFFICIENT_APPROVE'\n\n/**\n * The function checks if a given string value is a valid API error code.\n * @param {string} value - a string that represents a possible API error code.\n * @returns A boolean value is being returned, indicating whether the input `value` is of type\n * `APIErrorCode` or not.\n */\nexport function isAPIErrorCode(value: string): value is APIErrorCode {\n return [\n 'TX_FAIL',\n 'TX_EXPIRED',\n 'FETCH_TX_FAILED',\n 'USER_REJECT',\n 'USER_CANCEL',\n 'USER_CANCELED_TX',\n 'CALL_WALLET_FAILED',\n 'SEND_TX_FAILED',\n 'CALL_OR_SEND_FAILED',\n 'TX_FAILED_IN_BLOCKCHAIN',\n 'CLIENT_UNEXPECTED_BEHAVIOUR',\n 'INSUFFICIENT_APPROVE',\n ].includes(value)\n}\n\n/**\n * ReportTransactionRequest\n *\n * It should be used when an error happened in client and we want to inform server that transaction failed,\n * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.\n *\n * @property {string} requestId - The requestId from best route endpoint\n * @property {APIErrorCode} eventType - Type of the event that happened, example: USER_REJECT\n * @property {number} [step] - Step number in which failure happened\n * @property {string} [reason] - Reason or message for the error\n * @property {[key: string]: string} [data] - @deprecated A list of key-value for extra details\n * @property {wallet?: string, errorCode? string} [tags] - A list of key-value for pre-defined tags\n *\n */\nexport type ReportTransactionRequest = {\n requestId: string\n eventType: APIErrorCode\n step?: number\n reason?: string\n data?: { [key: string]: string }\n tags?: { wallet?: string; errorCode?: string }\n}\n\n/**\n * The status of transaction in tracking\n */\nexport enum TransactionStatus {\n FAILED = 'failed',\n RUNNING = 'running',\n SUCCESS = 'success',\n}\n\n/**\n * Response body of check-approval\n * You could stop check approval if:\n * 1- approved successfully\n * => isApproved = true\n * 2- approval transaction failed\n * => isApproved = false && txStatus === 'failed'\n * 3- approval transaction succeeded but currentApprovedAmount is still less than requiredApprovedAmount\n * (e.g. user changed transaction data and enter another approve amount in MetaMask)\n * => isApproved = false && txStatus == 'success'\n *\n * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not\n * @property {TransactionStatus | null} txStatus - Status of approve transaction in blockchain,\n * if isArppoved is false and txStatus is failed, it seems that approve transaction failed in blockchain\n * @property {string | null} requiredApprovedAmount - required amount to be approved by user\n * @property {string | null} currentApprovedAmount - current approved amount by user\n *\n */\nexport type CheckApprovalResponse = {\n isApproved: boolean\n txStatus: TransactionStatus | null\n requiredApprovedAmount: string | null\n currentApprovedAmount: string | null\n}\n","import { TransactionType } from '../transactions.js'\nimport { BaseTransaction } from './base.js'\n\nexport enum TonChainID {\n MAINNET = '-239',\n TESTNET = '-3',\n}\n\n/**\n * @property {string} address - Receiver's address\n * @property {string} amount - Amount to send in nanoTon\n * @property {string} [stateInit] - Contract specific data to add to the transaction\n * @property {string} [payload] - Contract specific data to add to the transaction\n */\nexport interface TonMessage {\n address: string\n amount: string\n stateInit?: string\n payload?: string\n}\n\n/**\n * This type of transaction is used for all Ton transactions\n *\n * @property {TransactionType} type - This field equals to TON for all Ton transactions\n * @property {number} validUntil - Sending transaction deadline in unix epoch seconds\n * @property {TonChainID} [network] - The network (mainnet or testnet) where DApp intends to send the transaction. If not set, the transaction is sent to the network currently set in the wallet, but this is not safe and DApp should always strive to set the network. If the network parameter is set, but the wallet has a different network set, the wallet should show an alert and DO NOT ALLOW TO SEND this transaction\n * @property {string} [from] - The sender address in '<wc>:<hex>' format from which DApp intends to send the transaction. Current account.address by default\n * @property {TonMessage[]} messages - Messages to send: min is 1, max is 4\n */\nexport interface TonTransaction extends BaseTransaction {\n type: TransactionType.TON\n validUntil: number\n network?: TonChainID\n from?: string\n messages: TonMessage[]\n}\n\nexport const isTonTransaction = (transaction: {\n type: TransactionType\n}): transaction is TonTransaction => transaction.type === TransactionType.TON\n","import uuid from 'uuid-random'\n\nimport {\n MetaRequest,\n MetaResponse,\n QuoteRequest,\n QuoteResponse,\n CheckApprovalResponse,\n StatusRequest,\n StatusResponse,\n SwapRequest,\n SwapResponse,\n ReportTransactionRequest,\n WalletDetailsResponse,\n assetToString,\n BlockchainMeta,\n RequestOptions,\n MessagingProtocolsResponse,\n SwapperMetaExtended,\n ConnectedAssetsResponse,\n ConnectedAssetsRequest,\n CustomTokenRequest,\n CustomTokenResponse,\n TokenBalanceRequest,\n TokenBalanceResponse,\n} from '../types'\nimport axios, { AxiosInstance } from 'axios'\n\ntype WalletAddress = { blockchain: string; address: string }\n\nexport class RangoClient {\n private readonly deviceId: string\n private readonly apiKey: string\n private readonly apiUrl: string\n private readonly httpService: AxiosInstance\n\n constructor(apiKey: string, debug = false, apiUrl?: string) {\n this.apiUrl = apiUrl || 'https://api.rango.exchange'\n this.apiKey = apiKey\n try {\n if (typeof window !== 'undefined') {\n const deviceId = localStorage.getItem('deviceId')\n if (deviceId) {\n this.deviceId = deviceId\n } else {\n const generatedId = uuid()\n localStorage.setItem('deviceId', generatedId)\n this.deviceId = generatedId\n }\n } else {\n this.deviceId = uuid()\n }\n } catch (e) {\n this.deviceId = uuid()\n }\n this.httpService = axios.create({\n baseURL: this.apiUrl,\n })\n if (debug) {\n this.httpService.interceptors.request.use((request) => {\n console.log('Starting Request', JSON.stringify(request, null, 2))\n return request\n })\n this.httpService.interceptors.response.use((response) => {\n console.log('Response:', JSON.stringify(response, null, 2))\n return response\n })\n }\n }\n\n public async meta(\n metaRequest?: MetaRequest,\n options?: RequestOptions\n ): Promise<MetaResponse> {\n const params = {\n ...metaRequest,\n blockchains: metaRequest?.blockchains?.join(),\n swappers: metaRequest?.swappers?.join(),\n swappersGroups: metaRequest?.swappersGroups?.join(),\n transactionTypes: metaRequest?.transactionTypes?.join(),\n }\n const axiosResponse = await this.httpService.get<MetaResponse>(\n `/basic/meta?apiKey=${this.apiKey}`,\n {\n params,\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async chains(options?: RequestOptions): Promise<BlockchainMeta[]> {\n const axiosResponse = await this.httpService.get<BlockchainMeta[]>(\n `/basic/meta/blockchains?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async swappers(options?: RequestOptions): Promise<SwapperMetaExtended[]> {\n const axiosResponse = await this.httpService.get<SwapperMetaExtended[]>(\n `/basic/meta/swappers?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n public async messagingProtocols(\n options?: RequestOptions\n ): Promise<MessagingProtocolsResponse> {\n const axiosResponse =\n await this.httpService.get<MessagingProtocolsResponse>(\n `/basic/meta/messaging-protocols?apiKey=${this.apiKey}`,\n { ...options }\n )\n return axiosResponse.data\n }\n\n\n public async token(\n customTokenRequest?: CustomTokenRequest,\n options?: RequestOptions\n ): Promise<CustomTokenResponse> {\n const axiosResponse = await this.httpService.get<CustomTokenResponse>(\n `/basic/meta/custom-token?apiKey=${this.apiKey}`,\n { params: customTokenRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async quote(\n quoteRequest: QuoteRequest,\n options?: RequestOptions\n ): Promise<QuoteResponse> {\n const body = {\n ...quoteRequest,\n from: assetToString(quoteRequest.from),\n to: assetToString(quoteRequest.to),\n swappers:\n !!quoteRequest.swappers && quoteRequest.swappers.length > 0\n ? quoteRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!quoteRequest.swapperGroups && quoteRequest.swapperGroups.length > 0\n ? quoteRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!quoteRequest.messagingProtocols &&\n quoteRequest.messagingProtocols.length > 0\n ? quoteRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<QuoteResponse>(\n `/basic/quote?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async isApproved(\n requestId: string,\n txId?: string,\n options?: RequestOptions\n ): Promise<CheckApprovalResponse> {\n const axiosResponse = await this.httpService.get<CheckApprovalResponse>(\n `/basic/is-approved?apiKey=${this.apiKey}`,\n {\n params: { requestId, txId },\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async status(\n statusRequest: StatusRequest,\n options?: RequestOptions\n ): Promise<StatusResponse> {\n const axiosResponse = await this.httpService.get<StatusResponse>(\n `/basic/status?apiKey=${this.apiKey}`,\n {\n params: statusRequest,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async swap(\n swapRequest: SwapRequest,\n options?: RequestOptions\n ): Promise<SwapResponse> {\n const body = {\n ...swapRequest,\n from: assetToString(swapRequest.from),\n to: assetToString(swapRequest.to),\n referrerAddress: swapRequest.referrerAddress || null,\n referrerFee: swapRequest.referrerFee || null,\n disableEstimate: swapRequest.disableEstimate || false,\n swappers:\n !!swapRequest.swappers && swapRequest.swappers.length > 0\n ? swapRequest.swappers.join(',')\n : undefined,\n swapperGroups:\n !!swapRequest.swapperGroups && swapRequest.swapperGroups.length > 0\n ? swapRequest.swapperGroups.join(',')\n : undefined,\n messagingProtocols:\n !!swapRequest.messagingProtocols &&\n swapRequest.messagingProtocols.length > 0\n ? swapRequest.messagingProtocols.join(',')\n : undefined,\n }\n const axiosResponse = await this.httpService.get<SwapResponse>(\n `/basic/swap?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async reportFailure(\n requestBody: ReportTransactionRequest,\n options?: RequestOptions\n ): Promise<void> {\n await this.httpService.post(\n `/basic/report-tx?apiKey=${this.apiKey}`,\n requestBody,\n {\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n }\n\n public async balance(\n walletAddress: WalletAddress,\n options?: RequestOptions\n ): Promise<WalletDetailsResponse> {\n const axiosResponse = await this.httpService.get<WalletDetailsResponse>(\n `/basic/balance?apiKey=${this.apiKey}`,\n {\n params: walletAddress,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n\n public async tokenBalance(\n tokenBalanceRequest: TokenBalanceRequest,\n options?: RequestOptions\n ): Promise<TokenBalanceResponse> {\n const axiosResponse = await this.httpService.get<TokenBalanceResponse>(\n `/basic/token-balance?apiKey=${this.apiKey}`,\n { params: tokenBalanceRequest, ...options }\n )\n return axiosResponse.data\n }\n\n public async connectedAssets(\n connectedAssetsRequest: ConnectedAssetsRequest,\n options?: RequestOptions\n ): Promise<ConnectedAssetsResponse> {\n const body = {\n from: assetToString(connectedAssetsRequest.from),\n }\n\n const axiosResponse = await this.httpService.get<ConnectedAssetsResponse>(\n `/basic/connected-assets?apiKey=${this.apiKey}`,\n {\n params: body,\n headers: { 'X-Rango-Id': this.deviceId },\n ...options,\n }\n )\n return axiosResponse.data\n }\n}\n"],"names":["assetToString","asset","address","blockchain","symbol","isEvmBlockchain","blockchainMeta","RangoClient","apiKey","debug","apiUrl","window","deviceId","localStorage","getItem","generatedId","uuid","setItem","e","httpService","axios","create","baseURL","interceptors","request","use","console","log","JSON","stringify","response","_proto","prototype","meta","_meta","_asyncToGenerator","_regeneratorRuntime","mark","_callee","metaRequest","options","_metaRequest$blockcha","_metaRequest$swappers","_metaRequest$swappers2","_metaRequest$transact","params","axiosResponse","wrap","_callee$","_context","prev","next","_extends","blockchains","join","swappers","swappersGroups","transactionTypes","get","sent","abrupt","data","stop","_x","_x2","apply","arguments","chains","_chains","_callee2","_callee2$","_context2","_x3","_swappers","_callee3","_callee3$","_context3","_x4","messagingProtocols","_messagingProtocols","_callee4","_callee4$","_context4","_x5","token","_token","_callee5","customTokenRequest","_callee5$","_context5","_x6","_x7","quote","_quote","_callee6","quoteRequest","body","_callee6$","_context6","from","to","length","undefined","swapperGroups","headers","_x8","_x9","isApproved","_isApproved","_callee7","requestId","txId","_callee7$","_context7","_x10","_x11","_x12","status","_status","_callee8","statusRequest","_callee8$","_context8","_x13","_x14","swap","_swap","_callee9","swapRequest","_callee9$","_context9","referrerAddress","referrerFee","disableEstimate","_x15","_x16","reportFailure","_reportFailure","_callee10","requestBody","_callee10$","_context10","post","_x17","_x18","balance","_balance","_callee11","walletAddress","_callee11$","_context11","_x19","_x20","tokenBalance","_tokenBalance","_callee12","tokenBalanceRequest","_callee12$","_context12","_x21","_x22","connectedAssets","_connectedAssets","_callee13","connectedAssetsRequest","_callee13$","_context13","_x23","_x24"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAGgBA,aAAaA,CAACC,KAAY;EACxC,IAAI,CAAC,CAACA,KAAK,CAACC,OAAO,EACjB,OAAUD,KAAK,CAACE,UAAU,SAAIF,KAAK,CAACG,MAAM,UAAKH,KAAK,CAACC,OAAO,CAAE,KAC3D,OAAUD,KAAK,CAACE,UAAU,SAAIF,KAAK,CAACG,MAAM;AACjD;;mBCkC8B,2BAAAC;;;qDAIUC;;;AAGtC;;;AAKF;;;yDAI0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzD1C;;;;AAIA,AAAA;gCAAY;;;;;;;ACJZ;;;AAGA,AAAA;;;;;;;;;AAUA,AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACqBA;;;;;;ICRaC,WAAW;EAMtB,SAAAA,YAAYC,MAAc,EAAEC,KAAK,EAAUC,MAAe;QAA9BD,KAAK;MAALA,KAAK,GAAG,KAAK;;IACvC,IAAI,CAACC,MAAM,GAAGA,MAAM,IAAI,4BAA4B;IACpD,IAAI,CAACF,MAAM,GAAGA,MAAM;IACpB,IAAI;MACF,IAAI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