@heliofi/common 0.2.256 → 0.2.258

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/dist/src/domain/model/audit/explorer/constants/ExplorerAuditAction.d.ts +2 -0
  2. package/dist/src/domain/model/audit/explorer/constants/ExplorerAuditAction.js +2 -0
  3. package/dist/src/domain/model/audit/explorer/constants/ExplorerAuditAction.js.map +1 -1
  4. package/dist/src/domain/model/audit/explorer/constants/ExplorerAuditActionType.js +2 -0
  5. package/dist/src/domain/model/audit/explorer/constants/ExplorerAuditActionType.js.map +1 -1
  6. package/dist/src/domain/model/company/dtos/index.d.ts +11 -8
  7. package/dist/src/domain/model/company/dtos/index.js +11 -8
  8. package/dist/src/domain/model/company/dtos/index.js.map +1 -1
  9. package/dist/src/domain/model/company/dtos/updateIronApiKey.dto.d.ts +6 -0
  10. package/dist/src/domain/model/company/dtos/updateIronApiKey.dto.js +37 -0
  11. package/dist/src/domain/model/company/dtos/updateIronApiKey.dto.js.map +1 -0
  12. package/dist/src/domain/model/company/dtos/updateMinimalDepositAmount.dto.d.ts +3 -0
  13. package/dist/src/domain/model/company/dtos/updateMinimalDepositAmount.dto.js +23 -0
  14. package/dist/src/domain/model/company/dtos/updateMinimalDepositAmount.dto.js.map +1 -0
  15. package/dist/src/domain/model/company/dtos/{UpdateMoonpayApiKey.dto.js → updateMoonpayApiKey.dto.js} +1 -1
  16. package/dist/src/domain/model/company/dtos/{UpdateMoonpayApiKey.dto.js.map → updateMoonpayApiKey.dto.js.map} +1 -1
  17. package/dist/src/domain/model/company/dtos/updateOneToOneSwapRoutes.dto.d.ts +3 -0
  18. package/dist/src/domain/model/company/dtos/updateOneToOneSwapRoutes.dto.js +21 -0
  19. package/dist/src/domain/model/company/dtos/updateOneToOneSwapRoutes.dto.js.map +1 -0
  20. package/dist/src/domain/model/company/dtos/{UpdateOnramperApiKey.dto.js → updateOnramperApiKey.dto.js} +1 -1
  21. package/dist/src/domain/model/company/dtos/{UpdateOnramperApiKey.dto.js.map → updateOnramperApiKey.dto.js.map} +1 -1
  22. package/dist/src/domain/model/company/entities/BaseCompany.entity.d.ts +1 -0
  23. package/dist/src/domain/model/company/entities/BaseCompany.entity.js.map +1 -1
  24. package/dist/src/domain/model/company/entities/CompanyWithFees.entity.d.ts +2 -0
  25. package/dist/src/domain/model/company/entities/CompanyWithFees.entity.js.map +1 -1
  26. package/dist/src/domain/model/company/entities/IronApiKeyConfig.entity.d.ts +6 -0
  27. package/dist/src/domain/model/company/entities/IronApiKeyConfig.entity.js +7 -0
  28. package/dist/src/domain/model/company/entities/IronApiKeyConfig.entity.js.map +1 -0
  29. package/dist/src/domain/model/company/entities/index.d.ts +1 -0
  30. package/dist/src/domain/model/company/entities/index.js +1 -0
  31. package/dist/src/domain/model/company/entities/index.js.map +1 -1
  32. package/dist/src/domain/model/decent-swap/index.d.ts +1 -0
  33. package/dist/src/domain/model/decent-swap/index.js +1 -0
  34. package/dist/src/domain/model/decent-swap/index.js.map +1 -1
  35. package/dist/src/domain/model/decent-swap/utils/index.d.ts +1 -0
  36. package/dist/src/domain/model/decent-swap/utils/index.js +18 -0
  37. package/dist/src/domain/model/decent-swap/utils/index.js.map +1 -0
  38. package/dist/src/domain/model/decent-swap/utils/selectBestDecentRoute.d.ts +7 -0
  39. package/dist/src/domain/model/decent-swap/utils/selectBestDecentRoute.js +134 -0
  40. package/dist/src/domain/model/decent-swap/utils/selectBestDecentRoute.js.map +1 -0
  41. package/dist/src/domain/model/decent-swap/utils/selectBestDecentRoute.spec.d.ts +1 -0
  42. package/dist/src/domain/model/decent-swap/utils/selectBestDecentRoute.spec.js +251 -0
  43. package/dist/src/domain/model/decent-swap/utils/selectBestDecentRoute.spec.js.map +1 -0
  44. package/dist/src/domain/model/on-ramps/dtos/getMoonPayPlatformTransaction.dto.d.ts +3 -0
  45. package/dist/src/domain/model/on-ramps/dtos/getMoonPayPlatformTransaction.dto.js +22 -0
  46. package/dist/src/domain/model/on-ramps/dtos/getMoonPayPlatformTransaction.dto.js.map +1 -0
  47. package/dist/src/domain/model/on-ramps/dtos/index.d.ts +2 -1
  48. package/dist/src/domain/model/on-ramps/dtos/index.js +2 -1
  49. package/dist/src/domain/model/on-ramps/dtos/index.js.map +1 -1
  50. package/dist/src/domain/model/on-ramps/entities/MoonPayPlatformTransaction.entity.d.ts +7 -0
  51. package/dist/src/domain/model/on-ramps/entities/MoonPayPlatformTransaction.entity.js +8 -0
  52. package/dist/src/domain/model/on-ramps/entities/MoonPayPlatformTransaction.entity.js.map +1 -0
  53. package/dist/src/domain/model/on-ramps/entities/index.d.ts +1 -0
  54. package/dist/src/domain/model/on-ramps/entities/index.js +1 -0
  55. package/dist/src/domain/model/on-ramps/entities/index.js.map +1 -1
  56. package/dist/src/domain/model/userGroups/entities/UserGroupPermissions.d.ts +1 -0
  57. package/dist/src/domain/model/userGroups/entities/UserGroupPermissions.js +1 -0
  58. package/dist/src/domain/model/userGroups/entities/UserGroupPermissions.js.map +1 -1
  59. package/dist/src/domain/model/withdraw/constants/{WithdrawFeature.d.ts → WithdrawalFeature.d.ts} +1 -1
  60. package/dist/src/domain/model/withdraw/constants/WithdrawalFeature.js +9 -0
  61. package/dist/src/domain/model/withdraw/constants/WithdrawalFeature.js.map +1 -0
  62. package/dist/src/domain/model/withdraw/constants/WithdrawalKind.d.ts +3 -0
  63. package/dist/src/domain/model/withdraw/constants/WithdrawalKind.js +8 -0
  64. package/dist/src/domain/model/withdraw/constants/WithdrawalKind.js.map +1 -0
  65. package/dist/src/domain/model/withdraw/constants/{WithdrawState.d.ts → WithdrawalState.d.ts} +1 -1
  66. package/dist/src/domain/model/withdraw/constants/WithdrawalState.js +16 -0
  67. package/dist/src/domain/model/withdraw/constants/WithdrawalState.js.map +1 -0
  68. package/dist/src/domain/model/withdraw/constants/{WithdrawTransactionDirection.d.ts → WithdrawalTransactionDirection.d.ts} +1 -1
  69. package/dist/src/domain/model/withdraw/constants/WithdrawalTransactionDirection.js +10 -0
  70. package/dist/src/domain/model/withdraw/constants/WithdrawalTransactionDirection.js.map +1 -0
  71. package/dist/src/domain/model/withdraw/constants/{WithdrawTransactionStatus.d.ts → WithdrawalTransactionStatus.d.ts} +1 -1
  72. package/dist/src/domain/model/withdraw/constants/WithdrawalTransactionStatus.js +10 -0
  73. package/dist/src/domain/model/withdraw/constants/WithdrawalTransactionStatus.js.map +1 -0
  74. package/dist/src/domain/model/withdraw/constants/index.d.ts +5 -5
  75. package/dist/src/domain/model/withdraw/constants/index.js +5 -5
  76. package/dist/src/domain/model/withdraw/constants/index.js.map +1 -1
  77. package/dist/src/domain/model/withdraw/dtos/{baseWithdraw.dto.d.ts → baseWithdrawalConfig.dto.d.ts} +3 -3
  78. package/dist/src/domain/model/withdraw/dtos/{baseWithdraw.dto.js → baseWithdrawalConfig.dto.js} +9 -9
  79. package/dist/src/domain/model/withdraw/dtos/baseWithdrawalConfig.dto.js.map +1 -0
  80. package/dist/src/domain/model/withdraw/dtos/createWithdrawalConfig.dto.d.ts +7 -0
  81. package/dist/src/domain/model/withdraw/dtos/{createWithdraw.dto.js → createWithdrawalConfig.dto.js} +10 -10
  82. package/dist/src/domain/model/withdraw/dtos/createWithdrawalConfig.dto.js.map +1 -0
  83. package/dist/src/domain/model/withdraw/dtos/index.d.ts +13 -13
  84. package/dist/src/domain/model/withdraw/dtos/index.js +13 -13
  85. package/dist/src/domain/model/withdraw/dtos/index.js.map +1 -1
  86. package/dist/src/domain/model/withdraw/dtos/preparedTransaction.dto.d.ts +2 -2
  87. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawal.dto.d.ts +6 -0
  88. package/dist/src/domain/model/withdraw/dtos/{preparedWithdraw.dto.js → preparedWithdrawal.dto.js} +11 -20
  89. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawal.dto.js.map +1 -0
  90. package/dist/src/domain/model/withdraw/dtos/{preparedWithdrawCall.dto.d.ts → preparedWithdrawalCall.dto.d.ts} +1 -1
  91. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalCall.dto.js +7 -0
  92. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalCall.dto.js.map +1 -0
  93. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalResponse.dto.d.ts +7 -0
  94. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalResponse.dto.js +7 -0
  95. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalResponse.dto.js.map +1 -0
  96. package/dist/src/domain/model/withdraw/dtos/{preparedWithdrawSummary.dto.d.ts → preparedWithdrawalSummary.dto.d.ts} +1 -1
  97. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalSummary.dto.js +7 -0
  98. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalSummary.dto.js.map +1 -0
  99. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalTypedData.dto.d.ts +8 -0
  100. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalTypedData.dto.js +7 -0
  101. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalTypedData.dto.js.map +1 -0
  102. package/dist/src/domain/model/withdraw/dtos/{preparedWithdrawTypedDataDomain.dto.d.ts → preparedWithdrawalTypedDataDomain.dto.d.ts} +1 -1
  103. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalTypedDataDomain.dto.js +7 -0
  104. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalTypedDataDomain.dto.js.map +1 -0
  105. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalTypedDataField.dto.d.ts +4 -0
  106. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalTypedDataField.dto.js +7 -0
  107. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawalTypedDataField.dto.js.map +1 -0
  108. package/dist/src/domain/model/withdraw/dtos/submitWithdrawal.dto.d.ts +5 -0
  109. package/dist/src/domain/model/withdraw/dtos/{submitWithdraw.dto.js → submitWithdrawal.dto.js} +9 -9
  110. package/dist/src/domain/model/withdraw/dtos/submitWithdrawal.dto.js.map +1 -0
  111. package/dist/src/domain/model/withdraw/dtos/submitWithdrawalResponse.dto.d.ts +8 -0
  112. package/dist/src/domain/model/withdraw/dtos/submitWithdrawalResponse.dto.js +7 -0
  113. package/dist/src/domain/model/withdraw/dtos/submitWithdrawalResponse.dto.js.map +1 -0
  114. package/dist/src/domain/model/withdraw/dtos/{submitWithdrawSignedTx.dto.d.ts → submitWithdrawalSignedTx.dto.d.ts} +1 -1
  115. package/dist/src/domain/model/withdraw/dtos/{submitWithdrawSignedTx.dto.js → submitWithdrawalSignedTx.dto.js} +6 -6
  116. package/dist/src/domain/model/withdraw/dtos/submitWithdrawalSignedTx.dto.js.map +1 -0
  117. package/dist/src/domain/model/withdraw/dtos/updateWithdrawalConfig.dto.d.ts +5 -0
  118. package/dist/src/domain/model/withdraw/dtos/{updateWithdraw.dto.js → updateWithdrawalConfig.dto.js} +7 -7
  119. package/dist/src/domain/model/withdraw/dtos/updateWithdrawalConfig.dto.js.map +1 -0
  120. package/dist/src/domain/model/withdraw/entities/{Withdraw.entity.d.ts → WithdrawalConfig.entity.d.ts} +3 -3
  121. package/dist/src/domain/model/withdraw/entities/WithdrawalConfig.entity.js +8 -0
  122. package/dist/src/domain/model/withdraw/entities/WithdrawalConfig.entity.js.map +1 -0
  123. package/dist/src/domain/model/withdraw/entities/{WithdrawCostBreakdown.entity.d.ts → WithdrawalCostBreakdown.entity.d.ts} +1 -1
  124. package/dist/src/domain/model/withdraw/entities/WithdrawalCostBreakdown.entity.js +7 -0
  125. package/dist/src/domain/model/withdraw/entities/WithdrawalCostBreakdown.entity.js.map +1 -0
  126. package/dist/src/domain/model/withdraw/entities/{WithdrawCustomerSwapRoute.entity.d.ts → WithdrawalCustomerSwapRoute.entity.d.ts} +1 -1
  127. package/dist/src/domain/model/withdraw/entities/WithdrawalCustomerSwapRoute.entity.js +7 -0
  128. package/dist/src/domain/model/withdraw/entities/WithdrawalCustomerSwapRoute.entity.js.map +1 -0
  129. package/dist/src/domain/model/withdraw/entities/WithdrawalCustomerSwapRoutesResponse.entity.d.ts +4 -0
  130. package/dist/src/domain/model/withdraw/entities/WithdrawalCustomerSwapRoutesResponse.entity.js +7 -0
  131. package/dist/src/domain/model/withdraw/entities/WithdrawalCustomerSwapRoutesResponse.entity.js.map +1 -0
  132. package/dist/src/domain/model/withdraw/entities/index.d.ts +4 -4
  133. package/dist/src/domain/model/withdraw/entities/index.js +4 -4
  134. package/dist/src/domain/model/withdraw/entities/index.js.map +1 -1
  135. package/dist/tsconfig.tsbuildinfo +1 -1
  136. package/package.json +2 -2
  137. package/dist/src/domain/model/withdraw/constants/WithdrawFeature.js +0 -9
  138. package/dist/src/domain/model/withdraw/constants/WithdrawFeature.js.map +0 -1
  139. package/dist/src/domain/model/withdraw/constants/WithdrawKind.d.ts +0 -3
  140. package/dist/src/domain/model/withdraw/constants/WithdrawKind.js +0 -8
  141. package/dist/src/domain/model/withdraw/constants/WithdrawKind.js.map +0 -1
  142. package/dist/src/domain/model/withdraw/constants/WithdrawState.js +0 -16
  143. package/dist/src/domain/model/withdraw/constants/WithdrawState.js.map +0 -1
  144. package/dist/src/domain/model/withdraw/constants/WithdrawTransactionDirection.js +0 -10
  145. package/dist/src/domain/model/withdraw/constants/WithdrawTransactionDirection.js.map +0 -1
  146. package/dist/src/domain/model/withdraw/constants/WithdrawTransactionStatus.js +0 -10
  147. package/dist/src/domain/model/withdraw/constants/WithdrawTransactionStatus.js.map +0 -1
  148. package/dist/src/domain/model/withdraw/dtos/baseWithdraw.dto.js.map +0 -1
  149. package/dist/src/domain/model/withdraw/dtos/createWithdraw.dto.d.ts +0 -7
  150. package/dist/src/domain/model/withdraw/dtos/createWithdraw.dto.js.map +0 -1
  151. package/dist/src/domain/model/withdraw/dtos/preparedWithdraw.dto.d.ts +0 -8
  152. package/dist/src/domain/model/withdraw/dtos/preparedWithdraw.dto.js.map +0 -1
  153. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawCall.dto.js +0 -7
  154. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawCall.dto.js.map +0 -1
  155. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawResponse.dto.d.ts +0 -7
  156. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawResponse.dto.js +0 -7
  157. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawResponse.dto.js.map +0 -1
  158. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawSummary.dto.js +0 -7
  159. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawSummary.dto.js.map +0 -1
  160. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawTypedData.dto.d.ts +0 -8
  161. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawTypedData.dto.js +0 -7
  162. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawTypedData.dto.js.map +0 -1
  163. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawTypedDataDomain.dto.js +0 -7
  164. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawTypedDataDomain.dto.js.map +0 -1
  165. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawTypedDataField.dto.d.ts +0 -4
  166. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawTypedDataField.dto.js +0 -7
  167. package/dist/src/domain/model/withdraw/dtos/preparedWithdrawTypedDataField.dto.js.map +0 -1
  168. package/dist/src/domain/model/withdraw/dtos/submitWithdraw.dto.d.ts +0 -5
  169. package/dist/src/domain/model/withdraw/dtos/submitWithdraw.dto.js.map +0 -1
  170. package/dist/src/domain/model/withdraw/dtos/submitWithdrawResponse.dto.d.ts +0 -8
  171. package/dist/src/domain/model/withdraw/dtos/submitWithdrawResponse.dto.js +0 -7
  172. package/dist/src/domain/model/withdraw/dtos/submitWithdrawResponse.dto.js.map +0 -1
  173. package/dist/src/domain/model/withdraw/dtos/submitWithdrawSignedTx.dto.js.map +0 -1
  174. package/dist/src/domain/model/withdraw/dtos/updateWithdraw.dto.d.ts +0 -5
  175. package/dist/src/domain/model/withdraw/dtos/updateWithdraw.dto.js.map +0 -1
  176. package/dist/src/domain/model/withdraw/entities/Withdraw.entity.js +0 -8
  177. package/dist/src/domain/model/withdraw/entities/Withdraw.entity.js.map +0 -1
  178. package/dist/src/domain/model/withdraw/entities/WithdrawCostBreakdown.entity.js +0 -7
  179. package/dist/src/domain/model/withdraw/entities/WithdrawCostBreakdown.entity.js.map +0 -1
  180. package/dist/src/domain/model/withdraw/entities/WithdrawCustomerSwapRoute.entity.js +0 -7
  181. package/dist/src/domain/model/withdraw/entities/WithdrawCustomerSwapRoute.entity.js.map +0 -1
  182. package/dist/src/domain/model/withdraw/entities/WithdrawCustomerSwapRoutesResponse.entity.d.ts +0 -4
  183. package/dist/src/domain/model/withdraw/entities/WithdrawCustomerSwapRoutesResponse.entity.js +0 -7
  184. package/dist/src/domain/model/withdraw/entities/WithdrawCustomerSwapRoutesResponse.entity.js.map +0 -1
  185. /package/dist/src/domain/model/company/dtos/{UpdateMoonpayApiKey.dto.d.ts → updateMoonpayApiKey.dto.d.ts} +0 -0
  186. /package/dist/src/domain/model/company/dtos/{UpdateOnramperApiKey.dto.d.ts → updateOnramperApiKey.dto.d.ts} +0 -0
@@ -0,0 +1,251 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const SwapOptions_1 = require("../entities/SwapOptions");
4
+ const selectBestDecentRoute_1 = require("./selectBestDecentRoute");
5
+ const USDC_SOLANA = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
6
+ const USDC_ARBITRUM = '0xaf88d065e77c8cc2239327c5edb3a432268e5831';
7
+ const usdcSolana = (amount) => ({
8
+ tokenAddress: USDC_SOLANA,
9
+ address: USDC_SOLANA,
10
+ decimals: 6,
11
+ symbol: 'USDC',
12
+ name: 'USD Coin',
13
+ chainId: 792703809,
14
+ amount,
15
+ });
16
+ function makeRoute(overrides = {}) {
17
+ return {
18
+ tx: { to: '0xrouter', data: '0xdeadbeef', value: '0', chainId: 42161 },
19
+ txId: 'tx-default',
20
+ vmId: 'vm-default',
21
+ amountIn: {
22
+ tokenAddress: USDC_ARBITRUM,
23
+ address: USDC_ARBITRUM,
24
+ decimals: 6,
25
+ symbol: 'USDT',
26
+ name: 'Tether USD',
27
+ chainId: 42161,
28
+ amount: '1000000',
29
+ },
30
+ amountInMax: {
31
+ tokenAddress: USDC_ARBITRUM,
32
+ address: USDC_ARBITRUM,
33
+ decimals: 6,
34
+ symbol: 'USDT',
35
+ name: 'Tether USD',
36
+ chainId: 42161,
37
+ amount: '1010000',
38
+ },
39
+ amountOut: usdcSolana('951400'),
40
+ amountOutMin: usdcSolana('941886'),
41
+ protocolFee: usdcSolana('0'),
42
+ applicationFee: usdcSolana('0'),
43
+ bridgeFee: usdcSolana('0'),
44
+ bridgeIds: ['relay'],
45
+ bridgeRoute: [],
46
+ exchangeRate: 0.9514,
47
+ estimatedTxTime: 30,
48
+ estimatedPriceImpact: 0.05,
49
+ ...overrides,
50
+ };
51
+ }
52
+ describe('selectBestDecentRoute', () => {
53
+ it('returns the input route unchanged when allRoutes is undefined', () => {
54
+ const route = makeRoute({ allRoutes: undefined });
55
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
56
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
57
+ });
58
+ expect(result).toBe(route);
59
+ });
60
+ it('returns the input route unchanged when allRoutes is empty', () => {
61
+ const route = makeRoute({ allRoutes: [] });
62
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
63
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
64
+ });
65
+ expect(result).toBe(route);
66
+ });
67
+ it('EXACT_IN: picks the alternative with higher net output (the 1:1 stablecoin route)', () => {
68
+ const oneToOne = makeRoute({
69
+ txId: 'tx-1to1',
70
+ amountOut: usdcSolana('1000000'),
71
+ amountOutMin: usdcSolana('990000'),
72
+ estimatedTxTime: 60,
73
+ });
74
+ const route = makeRoute({ allRoutes: [oneToOne] });
75
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
76
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
77
+ });
78
+ expect(result.txId).toBe('tx-1to1');
79
+ expect(result.amountOut.amount).toBe('1000000');
80
+ });
81
+ it('ranks by amountOut without subtracting reported fees (amountOut is already net)', () => {
82
+ const oneToOneWithFee = makeRoute({
83
+ txId: 'tx-1to1',
84
+ amountOut: usdcSolana('1000000'),
85
+ amountOutMin: usdcSolana('990000'),
86
+ bridgeFee: usdcSolana('60000'),
87
+ applicationFee: usdcSolana('5000'),
88
+ });
89
+ const route = makeRoute({ allRoutes: [oneToOneWithFee] });
90
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
91
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
92
+ });
93
+ expect(result.txId).toBe('tx-1to1');
94
+ });
95
+ it('EXACT_OUT: skips an alternative with missing payer cost (must not rank as cheapest)', () => {
96
+ const noCost = makeRoute({
97
+ txId: 'tx-nocost',
98
+ amountInMax: undefined,
99
+ amountIn: undefined,
100
+ });
101
+ const route = makeRoute({ allRoutes: [noCost] });
102
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
103
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_OUT,
104
+ });
105
+ expect(result.txId).toBe('tx-default');
106
+ });
107
+ it('EXACT_OUT: a valid alternative is still chosen when the default route has no payer cost', () => {
108
+ const validAlt = makeRoute({ txId: 'tx-valid' });
109
+ const route = makeRoute({
110
+ txId: 'tx-default',
111
+ amountInMax: undefined,
112
+ amountIn: undefined,
113
+ allRoutes: [validAlt],
114
+ });
115
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
116
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_OUT,
117
+ });
118
+ expect(result.txId).toBe('tx-valid');
119
+ });
120
+ it('EXACT_OUT: picks the alternative with lower payer cost (amountInMax)', () => {
121
+ const cheaper = makeRoute({
122
+ txId: 'tx-cheaper',
123
+ amountInMax: {
124
+ tokenAddress: USDC_ARBITRUM,
125
+ address: USDC_ARBITRUM,
126
+ decimals: 6,
127
+ symbol: 'USDT',
128
+ name: 'Tether USD',
129
+ chainId: 42161,
130
+ amount: '1002000',
131
+ },
132
+ });
133
+ const route = makeRoute({ allRoutes: [cheaper] });
134
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
135
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_OUT,
136
+ });
137
+ expect(result.txId).toBe('tx-cheaper');
138
+ });
139
+ it('skips alternatives without an executable tx even if their output is higher', () => {
140
+ const noTx = makeRoute({
141
+ txId: 'tx-notexec',
142
+ tx: {},
143
+ amountOut: usdcSolana('1000000'),
144
+ amountOutMin: usdcSolana('990000'),
145
+ });
146
+ const route = makeRoute({ allRoutes: [noTx] });
147
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
148
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
149
+ });
150
+ expect(result.txId).toBe('tx-default');
151
+ });
152
+ it('skips alternatives with malformed amountOutMin (greater than amountOut)', () => {
153
+ const malformed = makeRoute({
154
+ txId: 'tx-malformed',
155
+ amountOut: usdcSolana('1000000'),
156
+ amountOutMin: usdcSolana('1100000'),
157
+ });
158
+ const route = makeRoute({ allRoutes: [malformed] });
159
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
160
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
161
+ });
162
+ expect(result.txId).toBe('tx-default');
163
+ });
164
+ it('never returns a route worse than the default', () => {
165
+ const worse = makeRoute({
166
+ txId: 'tx-worse',
167
+ amountOut: usdcSolana('900000'),
168
+ amountOutMin: usdcSolana('891000'),
169
+ });
170
+ const route = makeRoute({ allRoutes: [worse] });
171
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
172
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
173
+ });
174
+ expect(result.txId).toBe('tx-default');
175
+ });
176
+ it('on equal net output, prefers the faster route', () => {
177
+ const sameOutputFaster = makeRoute({
178
+ txId: 'tx-fast',
179
+ estimatedTxTime: 10,
180
+ });
181
+ const route = makeRoute({ allRoutes: [sameOutputFaster] });
182
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
183
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
184
+ });
185
+ expect(result.txId).toBe('tx-fast');
186
+ });
187
+ it('on equal net output and equal time, prefers lower price impact', () => {
188
+ const sameOutputLowerImpact = makeRoute({
189
+ txId: 'tx-lowimpact',
190
+ estimatedPriceImpact: 0.01,
191
+ });
192
+ const route = makeRoute({ allRoutes: [sameOutputLowerImpact] });
193
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
194
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
195
+ });
196
+ expect(result.txId).toBe('tx-lowimpact');
197
+ });
198
+ it('skips routes exceeding maxEstimatedTxTime even if their output is higher', () => {
199
+ const slowButBetter = makeRoute({
200
+ txId: 'tx-slow',
201
+ amountOut: usdcSolana('1000000'),
202
+ amountOutMin: usdcSolana('990000'),
203
+ estimatedTxTime: 600,
204
+ });
205
+ const route = makeRoute({ allRoutes: [slowButBetter] });
206
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
207
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
208
+ maxEstimatedTxTime: 120,
209
+ });
210
+ expect(result.txId).toBe('tx-default');
211
+ });
212
+ it('strips allRoutes from the returned route', () => {
213
+ const oneToOne = makeRoute({
214
+ txId: 'tx-1to1',
215
+ amountOut: usdcSolana('1000000'),
216
+ amountOutMin: usdcSolana('990000'),
217
+ });
218
+ const route = makeRoute({ allRoutes: [oneToOne] });
219
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
220
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
221
+ });
222
+ expect(result.allRoutes).toBeUndefined();
223
+ });
224
+ it('selects the best across several alternatives', () => {
225
+ const route = makeRoute({
226
+ allRoutes: [
227
+ makeRoute({
228
+ txId: 'a',
229
+ amountOut: usdcSolana('960000'),
230
+ amountOutMin: usdcSolana('950400'),
231
+ }),
232
+ makeRoute({
233
+ txId: 'b',
234
+ amountOut: usdcSolana('999500'),
235
+ amountOutMin: usdcSolana('989505'),
236
+ }),
237
+ makeRoute({
238
+ txId: 'c',
239
+ amountOut: usdcSolana('980000'),
240
+ amountOutMin: usdcSolana('970200'),
241
+ }),
242
+ ],
243
+ });
244
+ const result = (0, selectBestDecentRoute_1.selectBestDecentRoute)(route, {
245
+ swapDirection: SwapOptions_1.DecentSwapOptions.EXACT_IN,
246
+ });
247
+ expect(result.txId).toBe('b');
248
+ expect(result.amountOut.amount).toBe('999500');
249
+ });
250
+ });
251
+ //# sourceMappingURL=selectBestDecentRoute.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectBestDecentRoute.spec.js","sourceRoot":"","sources":["../../../../../../src/domain/model/decent-swap/utils/selectBestDecentRoute.spec.ts"],"names":[],"mappings":";;AAIA,yDAA4D;AAC5D,mEAAgE;AAEhE,MAAM,WAAW,GAAG,8CAA8C,CAAC;AACnE,MAAM,aAAa,GAAG,4CAA4C,CAAC;AAEnE,MAAM,UAAU,GAAG,CAAC,MAAc,EAAqB,EAAE,CAAC,CAAC;IACzD,YAAY,EAAE,WAAW;IACzB,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,CAAC;IACX,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM;CACP,CAAC,CAAC;AAEH,SAAS,SAAS,CAAC,YAAsC,EAAE;IACzD,OAAO;QACL,EAAE,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,KAA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C1C,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare class GetMoonPayPlatformTransactionDto {
2
+ depositCustomerId: string;
3
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GetMoonPayPlatformTransactionDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ class GetMoonPayPlatformTransactionDto {
15
+ }
16
+ exports.GetMoonPayPlatformTransactionDto = GetMoonPayPlatformTransactionDto;
17
+ __decorate([
18
+ (0, class_validator_1.IsMongoId)(),
19
+ (0, class_validator_1.IsNotEmpty)(),
20
+ __metadata("design:type", String)
21
+ ], GetMoonPayPlatformTransactionDto.prototype, "depositCustomerId", void 0);
22
+ //# sourceMappingURL=getMoonPayPlatformTransaction.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getMoonPayPlatformTransaction.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/on-ramps/dtos/getMoonPayPlatformTransaction.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAwD;AAExD,MAAa,gCAAgC;CAI5C;AAJD,4EAIC;AADC;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;2EACa"}
@@ -1,6 +1,7 @@
1
1
  export * from './createMoonPayPlatformCompanySession.dto';
2
+ export * from './getMoonPayPlatformQuote.dto';
3
+ export * from './getMoonPayPlatformTransaction.dto';
2
4
  export * from './MoonPayPaymentMethodConfigQuery.dto';
3
5
  export * from './moonpayPlatformWebhookPayload.dto';
4
6
  export * from './MoonPayUrl.dto';
5
7
  export * from './createMoonPayPlatformSession.dto';
6
- export * from './getMoonPayPlatformQuote.dto';
@@ -15,9 +15,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./createMoonPayPlatformCompanySession.dto"), exports);
18
+ __exportStar(require("./getMoonPayPlatformQuote.dto"), exports);
19
+ __exportStar(require("./getMoonPayPlatformTransaction.dto"), exports);
18
20
  __exportStar(require("./MoonPayPaymentMethodConfigQuery.dto"), exports);
19
21
  __exportStar(require("./moonpayPlatformWebhookPayload.dto"), exports);
20
22
  __exportStar(require("./MoonPayUrl.dto"), exports);
21
23
  __exportStar(require("./createMoonPayPlatformSession.dto"), exports);
22
- __exportStar(require("./getMoonPayPlatformQuote.dto"), exports);
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/domain/model/on-ramps/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4EAA0D;AAC1D,wEAAsD;AACtD,sEAAoD;AACpD,mDAAiC;AACjC,qEAAmD;AACnD,gEAA8C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/domain/model/on-ramps/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4EAA0D;AAC1D,gEAA8C;AAC9C,sEAAoD;AACpD,wEAAsD;AACtD,sEAAoD;AACpD,mDAAiC;AACjC,qEAAmD"}
@@ -0,0 +1,7 @@
1
+ import { Entity } from '../../entity';
2
+ export declare class MoonPayPlatformTransaction extends Entity {
3
+ id: string;
4
+ status: 'waitingPayment' | 'pending' | 'waitingAuthorization' | 'completed' | 'failed';
5
+ cryptoTransactionId?: string;
6
+ failureReason?: string;
7
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MoonPayPlatformTransaction = void 0;
4
+ const entity_1 = require("../../entity");
5
+ class MoonPayPlatformTransaction extends entity_1.Entity {
6
+ }
7
+ exports.MoonPayPlatformTransaction = MoonPayPlatformTransaction;
8
+ //# sourceMappingURL=MoonPayPlatformTransaction.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MoonPayPlatformTransaction.entity.js","sourceRoot":"","sources":["../../../../../../src/domain/model/on-ramps/entities/MoonPayPlatformTransaction.entity.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC,MAAa,0BAA2B,SAAQ,eAAM;CAarD;AAbD,gEAaC"}
@@ -1,5 +1,6 @@
1
1
  export * from './MoonPayPaymentMethodConfig.entity';
2
2
  export * from './MoonPayPlatformQuote.entity';
3
3
  export * from './MoonPayPlatformSession.entity';
4
+ export * from './MoonPayPlatformTransaction.entity';
4
5
  export * from './MoonPayTransactionType';
5
6
  export * from './MoonPayUrlSignature.entity';
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./MoonPayPaymentMethodConfig.entity"), exports);
18
18
  __exportStar(require("./MoonPayPlatformQuote.entity"), exports);
19
19
  __exportStar(require("./MoonPayPlatformSession.entity"), exports);
20
+ __exportStar(require("./MoonPayPlatformTransaction.entity"), exports);
20
21
  __exportStar(require("./MoonPayTransactionType"), exports);
21
22
  __exportStar(require("./MoonPayUrlSignature.entity"), exports);
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/domain/model/on-ramps/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAoD;AACpD,gEAA8C;AAC9C,kEAAgD;AAChD,2DAAyC;AACzC,+DAA6C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/domain/model/on-ramps/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAoD;AACpD,gEAA8C;AAC9C,kEAAgD;AAChD,sEAAoD;AACpD,2DAAyC;AACzC,+DAA6C"}
@@ -102,6 +102,7 @@ export declare enum UserGroupPermission {
102
102
  STRIPE_API_KEY_READ = "STRIPE_API_KEY_READ",
103
103
  STRIPE_API_KEY_WRITE = "STRIPE_API_KEY_WRITE",
104
104
  MOONPAY_API_KEY_READ = "MOONPAY_API_KEY_READ",
105
+ IRON_API_KEY_READ = "IRON_API_KEY_READ",
105
106
  ONRAMPER_API_KEY_READ = "ONRAMPER_API_KEY_READ",
106
107
  WEBHOOK_ADMIN = "WEBHOOK_ADMIN",
107
108
  WEBHOOK_WRITE = "WEBHOOK_WRITE",
@@ -106,6 +106,7 @@ var UserGroupPermission;
106
106
  UserGroupPermission["STRIPE_API_KEY_READ"] = "STRIPE_API_KEY_READ";
107
107
  UserGroupPermission["STRIPE_API_KEY_WRITE"] = "STRIPE_API_KEY_WRITE";
108
108
  UserGroupPermission["MOONPAY_API_KEY_READ"] = "MOONPAY_API_KEY_READ";
109
+ UserGroupPermission["IRON_API_KEY_READ"] = "IRON_API_KEY_READ";
109
110
  UserGroupPermission["ONRAMPER_API_KEY_READ"] = "ONRAMPER_API_KEY_READ";
110
111
  UserGroupPermission["WEBHOOK_ADMIN"] = "WEBHOOK_ADMIN";
111
112
  UserGroupPermission["WEBHOOK_WRITE"] = "WEBHOOK_WRITE";
@@ -1 +1 @@
1
- {"version":3,"file":"UserGroupPermissions.js","sourceRoot":"","sources":["../../../../../../src/domain/model/userGroups/entities/UserGroupPermissions.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAqHX;AArHD,WAAY,mBAAmB;IAC7B,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,oCAAa,CAAA;IACb,sDAA+B,CAAA;IAC/B,sDAA+B,CAAA;IAC/B,oDAA6B,CAAA;IAC7B,wDAAiC,CAAA;IACjC,kEAA2C,CAAA;IAC3C,wDAAiC,CAAA;IACjC,kEAA2C,CAAA;IAC3C,oFAA6D,CAAA;IAC7D,oFAA6D,CAAA;IAC7D,8EAAuD,CAAA;IACvD,0DAAmC,CAAA;IACnC,kEAA2C,CAAA;IAC3C,8DAAuC,CAAA;IACvC,8DAAuC,CAAA;IACvC,0DAAmC,CAAA;IACnC,0DAAmC,CAAA;IACnC,wDAAiC,CAAA;IACjC,4DAAqC,CAAA;IACrC,sEAA+C,CAAA;IAC/C,4DAAqC,CAAA;IACrC,sEAA+C,CAAA;IAC/C,wFAAiE,CAAA;IACjE,wFAAiE,CAAA;IACjE,kFAA2D,CAAA;IAC3D,8DAAuC,CAAA;IACvC,sEAA+C,CAAA;IAC/C,kEAA2C,CAAA;IAE3C,wDAAiC,CAAA;IACjC,wDAAiC,CAAA;IACjC,0DAAmC,CAAA;IACnC,sDAA+B,CAAA;IAC/B,0DAAmC,CAAA;IAEnC,0DAAmC,CAAA;IACnC,0DAAmC,CAAA;IACnC,4DAAqC,CAAA;IACrC,wDAAiC,CAAA;IACjC,4DAAqC,CAAA;IAErC,0EAAmD,CAAA;IACnD,0EAAmD,CAAA;IACnD,4EAAqD,CAAA;IAErD,sDAA+B,CAAA;IAC/B,sDAA+B,CAAA;IAC/B,oDAA6B,CAAA;IAC7B,oEAA6C,CAAA;IAC7C,wDAAiC,CAAA;IACjC,sDAA+B,CAAA;IAC/B,sDAA+B,CAAA;IAC/B,wDAAiC,CAAA;IACjC,wDAAiC,CAAA;IAC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IACjC,8EAAuD,CAAA;IACvD,gEAAyC,CAAA;AAC3C,CAAC,EArHW,mBAAmB,mCAAnB,mBAAmB,QAqH9B"}
1
+ {"version":3,"file":"UserGroupPermissions.js","sourceRoot":"","sources":["../../../../../../src/domain/model/userGroups/entities/UserGroupPermissions.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAsHX;AAtHD,WAAY,mBAAmB;IAC7B,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,oCAAa,CAAA;IACb,sDAA+B,CAAA;IAC/B,sDAA+B,CAAA;IAC/B,oDAA6B,CAAA;IAC7B,wDAAiC,CAAA;IACjC,kEAA2C,CAAA;IAC3C,wDAAiC,CAAA;IACjC,kEAA2C,CAAA;IAC3C,oFAA6D,CAAA;IAC7D,oFAA6D,CAAA;IAC7D,8EAAuD,CAAA;IACvD,0DAAmC,CAAA;IACnC,kEAA2C,CAAA;IAC3C,8DAAuC,CAAA;IACvC,8DAAuC,CAAA;IACvC,0DAAmC,CAAA;IACnC,0DAAmC,CAAA;IACnC,wDAAiC,CAAA;IACjC,4DAAqC,CAAA;IACrC,sEAA+C,CAAA;IAC/C,4DAAqC,CAAA;IACrC,sEAA+C,CAAA;IAC/C,wFAAiE,CAAA;IACjE,wFAAiE,CAAA;IACjE,kFAA2D,CAAA;IAC3D,8DAAuC,CAAA;IACvC,sEAA+C,CAAA;IAC/C,kEAA2C,CAAA;IAE3C,wDAAiC,CAAA;IACjC,wDAAiC,CAAA;IACjC,0DAAmC,CAAA;IACnC,sDAA+B,CAAA;IAC/B,0DAAmC,CAAA;IAEnC,0DAAmC,CAAA;IACnC,0DAAmC,CAAA;IACnC,4DAAqC,CAAA;IACrC,wDAAiC,CAAA;IACjC,4DAAqC,CAAA;IAErC,0EAAmD,CAAA;IACnD,0EAAmD,CAAA;IACnD,4EAAqD,CAAA;IAErD,sDAA+B,CAAA;IAC/B,sDAA+B,CAAA;IAC/B,oDAA6B,CAAA;IAC7B,oEAA6C,CAAA;IAC7C,wDAA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A+B,CAAA;IAC/B,sDAA+B,CAAA;IAC/B,oDAA6B,CAAA;IAC7B,wDAAiC,CAAA;IACjC,wDAAiC,CAAA;IACjC,wDAAiC,CAAA;IACjC,8EAAuD,CAAA;IACvD,gEAAyC,CAAA;AAC3C,CAAC,EAtHW,mBAAmB,mCAAnB,mBAAmB,QAsH9B"}
@@ -1,4 +1,4 @@
1
- export declare enum WithdrawFeature {
1
+ export declare enum WithdrawalFeature {
2
2
  IRON = "iron",
3
3
  MP_SELL = "mp_sell"
4
4
  }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WithdrawalFeature = void 0;
4
+ var WithdrawalFeature;
5
+ (function (WithdrawalFeature) {
6
+ WithdrawalFeature["IRON"] = "iron";
7
+ WithdrawalFeature["MP_SELL"] = "mp_sell";
8
+ })(WithdrawalFeature || (exports.WithdrawalFeature = WithdrawalFeature = {}));
9
+ //# sourceMappingURL=WithdrawalFeature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithdrawalFeature.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/constants/WithdrawalFeature.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,wCAAmB,CAAA;AACrB,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B"}
@@ -0,0 +1,3 @@
1
+ export declare enum WithdrawalKind {
2
+ POLYMARKET = "polymarket"
3
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WithdrawalKind = void 0;
4
+ var WithdrawalKind;
5
+ (function (WithdrawalKind) {
6
+ WithdrawalKind["POLYMARKET"] = "polymarket";
7
+ })(WithdrawalKind || (exports.WithdrawalKind = WithdrawalKind = {}));
8
+ //# sourceMappingURL=WithdrawalKind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithdrawalKind.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/constants/WithdrawalKind.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,2CAAyB,CAAA;AAC3B,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB"}
@@ -1,4 +1,4 @@
1
- export declare enum WithdrawState {
1
+ export declare enum WithdrawalState {
2
2
  QUOTED = "QUOTED",
3
3
  SUBMITTING = "SUBMITTING",
4
4
  SUBMITTED = "SUBMITTED",
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WithdrawalState = void 0;
4
+ var WithdrawalState;
5
+ (function (WithdrawalState) {
6
+ WithdrawalState["QUOTED"] = "QUOTED";
7
+ WithdrawalState["SUBMITTING"] = "SUBMITTING";
8
+ WithdrawalState["SUBMITTED"] = "SUBMITTED";
9
+ WithdrawalState["BRIDGING"] = "BRIDGING";
10
+ WithdrawalState["COMPLETED"] = "COMPLETED";
11
+ WithdrawalState["FAILED"] = "FAILED";
12
+ WithdrawalState["FAILED_EXPIRED"] = "FAILED_EXPIRED";
13
+ WithdrawalState["EXPIRED"] = "EXPIRED";
14
+ WithdrawalState["REFUNDED_BY_PROVIDER"] = "REFUNDED_BY_PROVIDER";
15
+ })(WithdrawalState || (exports.WithdrawalState = WithdrawalState = {}));
16
+ //# sourceMappingURL=WithdrawalState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithdrawalState.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/constants/WithdrawalState.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAaX;AAbD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IAIjB,4CAAyB,CAAA;IACzB,0CAAuB,CAAA;IACvB,wCAAqB,CAAA;IACrB,0CAAuB,CAAA;IACvB,oCAAiB,CAAA;IACjB,oDAAiC,CAAA;IACjC,sCAAmB,CAAA;IACnB,gEAA6C,CAAA;AAC/C,CAAC,EAbW,eAAe,+BAAf,eAAe,QAa1B"}
@@ -1,4 +1,4 @@
1
- export declare enum WithdrawTransactionDirection {
1
+ export declare enum WithdrawalTransactionDirection {
2
2
  SUBMIT = "submit",
3
3
  BRIDGE = "bridge",
4
4
  DESTINATION = "destination"
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WithdrawalTransactionDirection = void 0;
4
+ var WithdrawalTransactionDirection;
5
+ (function (WithdrawalTransactionDirection) {
6
+ WithdrawalTransactionDirection["SUBMIT"] = "submit";
7
+ WithdrawalTransactionDirection["BRIDGE"] = "bridge";
8
+ WithdrawalTransactionDirection["DESTINATION"] = "destination";
9
+ })(WithdrawalTransactionDirection || (exports.WithdrawalTransactionDirection = WithdrawalTransactionDirection = {}));
10
+ //# sourceMappingURL=WithdrawalTransactionDirection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithdrawalTransactionDirection.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/constants/WithdrawalTransactionDirection.ts"],"names":[],"mappings":";;;AAAA,IAAY,8BAIX;AAJD,WAAY,8BAA8B;IACxC,mDAAiB,CAAA;IACjB,mDAAiB,CAAA;IACjB,6DAA2B,CAAA;AAC7B,CAAC,EAJW,8BAA8B,8CAA9B,8BAA8B,QAIzC"}
@@ -1,4 +1,4 @@
1
- export declare enum WithdrawTransactionStatus {
1
+ export declare enum WithdrawalTransactionStatus {
2
2
  PENDING = "pending",
3
3
  CONFIRMED = "confirmed",
4
4
  FAILED = "failed"
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WithdrawalTransactionStatus = void 0;
4
+ var WithdrawalTransactionStatus;
5
+ (function (WithdrawalTransactionStatus) {
6
+ WithdrawalTransactionStatus["PENDING"] = "pending";
7
+ WithdrawalTransactionStatus["CONFIRMED"] = "confirmed";
8
+ WithdrawalTransactionStatus["FAILED"] = "failed";
9
+ })(WithdrawalTransactionStatus || (exports.WithdrawalTransactionStatus = WithdrawalTransactionStatus = {}));
10
+ //# sourceMappingURL=WithdrawalTransactionStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WithdrawalTransactionStatus.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/constants/WithdrawalTransactionStatus.ts"],"names":[],"mappings":";;;AAAA,IAAY,2BAIX;AAJD,WAAY,2BAA2B;IACrC,kDAAmB,CAAA;IACnB,sDAAuB,CAAA;IACvB,gDAAiB,CAAA;AACnB,CAAC,EAJW,2BAA2B,2CAA3B,2BAA2B,QAItC"}
@@ -1,8 +1,8 @@
1
1
  export * from './BroadcastAck';
2
2
  export * from './SmartWalletKind';
3
3
  export * from './SourceWalletKind';
4
- export * from './WithdrawFeature';
5
- export * from './WithdrawState';
6
- export * from './WithdrawTransactionDirection';
7
- export * from './WithdrawTransactionStatus';
8
- export * from './WithdrawKind';
4
+ export * from './WithdrawalFeature';
5
+ export * from './WithdrawalState';
6
+ export * from './WithdrawalTransactionDirection';
7
+ export * from './WithdrawalTransactionStatus';
8
+ export * from './WithdrawalKind';
@@ -17,9 +17,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./BroadcastAck"), exports);
18
18
  __exportStar(require("./SmartWalletKind"), exports);
19
19
  __exportStar(require("./SourceWalletKind"), exports);
20
- __exportStar(require("./WithdrawFeature"), exports);
21
- __exportStar(require("./WithdrawState"), exports);
22
- __exportStar(require("./WithdrawTransactionDirection"), exports);
23
- __exportStar(require("./WithdrawTransactionStatus"), exports);
24
- __exportStar(require("./WithdrawKind"), exports);
20
+ __exportStar(require("./WithdrawalFeature"), exports);
21
+ __exportStar(require("./WithdrawalState"), exports);
22
+ __exportStar(require("./WithdrawalTransactionDirection"), exports);
23
+ __exportStar(require("./WithdrawalTransactionStatus"), exports);
24
+ __exportStar(require("./WithdrawalKind"), exports);
25
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,oDAAkC;AAClC,kDAAgC;AAChC,iEAA+C;AAC/C,8DAA4C;AAC5C,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,sDAAoC;AACpC,oDAAkC;AAClC,mEAAiD;AACjD,gEAA8C;AAC9C,mDAAiC"}
@@ -1,7 +1,7 @@
1
1
  import { BlockchainSymbol } from '../../blockchain/constants/BlockchainSymbol';
2
- import { WithdrawFeature } from '../constants/WithdrawFeature';
3
- export declare class BaseWithdrawDto {
2
+ import { WithdrawalFeature } from '../constants/WithdrawalFeature';
3
+ export declare class BaseWithdrawalConfigDto {
4
4
  disabled?: boolean;
5
5
  disabledBlockchainSymbols?: BlockchainSymbol[];
6
- enabledFeatures?: WithdrawFeature[];
6
+ enabledFeatures?: WithdrawalFeature[];
7
7
  }
@@ -9,28 +9,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.BaseWithdrawDto = void 0;
12
+ exports.BaseWithdrawalConfigDto = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const BlockchainSymbol_1 = require("../../blockchain/constants/BlockchainSymbol");
15
- const WithdrawFeature_1 = require("../constants/WithdrawFeature");
16
- class BaseWithdrawDto {
15
+ const WithdrawalFeature_1 = require("../constants/WithdrawalFeature");
16
+ class BaseWithdrawalConfigDto {
17
17
  }
18
- exports.BaseWithdrawDto = BaseWithdrawDto;
18
+ exports.BaseWithdrawalConfigDto = BaseWithdrawalConfigDto;
19
19
  __decorate([
20
20
  (0, class_validator_1.IsBoolean)(),
21
21
  (0, class_validator_1.IsOptional)(),
22
22
  __metadata("design:type", Boolean)
23
- ], BaseWithdrawDto.prototype, "disabled", void 0);
23
+ ], BaseWithdrawalConfigDto.prototype, "disabled", void 0);
24
24
  __decorate([
25
25
  (0, class_validator_1.IsArray)(),
26
26
  (0, class_validator_1.IsEnum)(BlockchainSymbol_1.BlockchainSymbol, { each: true }),
27
27
  (0, class_validator_1.IsOptional)(),
28
28
  __metadata("design:type", Array)
29
- ], BaseWithdrawDto.prototype, "disabledBlockchainSymbols", void 0);
29
+ ], BaseWithdrawalConfigDto.prototype, "disabledBlockchainSymbols", void 0);
30
30
  __decorate([
31
31
  (0, class_validator_1.IsArray)(),
32
- (0, class_validator_1.IsEnum)(WithdrawFeature_1.WithdrawFeature, { each: true }),
32
+ (0, class_validator_1.IsEnum)(WithdrawalFeature_1.WithdrawalFeature, { each: true }),
33
33
  (0, class_validator_1.IsOptional)(),
34
34
  __metadata("design:type", Array)
35
- ], BaseWithdrawDto.prototype, "enabledFeatures", void 0);
36
- //# sourceMappingURL=baseWithdraw.dto.js.map
35
+ ], BaseWithdrawalConfigDto.prototype, "enabledFeatures", void 0);
36
+ //# sourceMappingURL=baseWithdrawalConfig.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseWithdrawalConfig.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/withdraw/dtos/baseWithdrawalConfig.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAyE;AACzE,kFAA+E;AAC/E,sEAAmE;AAEnE,MAAa,uBAAuB;CAcnC;AAdD,0DAcC;AAXC;IAFC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;;yDACM;AAKnB;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,wBAAM,EAAC,mCAAgB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxC,IAAA,4BAAU,GAAE;;0EACkC;AAK/C;IAHC,IAAA,yBAAO,GAAE;IACT,IAAA,wBAAM,EAAC,qCAAiB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACzC,IAAA,4BAAU,GAAE;;gEACyB"}
@@ -0,0 +1,7 @@
1
+ import { WithdrawalKind } from '../constants/WithdrawalKind';
2
+ import { BaseWithdrawalConfigDto } from './baseWithdrawalConfig.dto';
3
+ export declare class CreateWithdrawalConfigDto extends BaseWithdrawalConfigDto {
4
+ kind: WithdrawalKind;
5
+ name: string;
6
+ currencyIds: string[];
7
+ }