@rainlanguage/ui-components 0.0.1-alpha.21 → 0.0.1-alpha.210

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 (260) hide show
  1. package/dist/__fixtures__/settings.yaml +125 -0
  2. package/dist/__mocks__/CodeMirrorRainlang.svelte +4 -0
  3. package/dist/__mocks__/CodeMirrorRainlang.svelte.d.ts +18 -0
  4. package/dist/__mocks__/MockComponent.svelte +4 -0
  5. package/dist/__mocks__/MockComponent.svelte.d.ts +3 -1
  6. package/dist/__mocks__/stores.d.ts +47 -33
  7. package/dist/__mocks__/stores.js +61 -38
  8. package/dist/components/ButtonLoading.svelte +1 -1
  9. package/dist/components/ButtonVaultLink.svelte +11 -11
  10. package/dist/components/ButtonVaultLink.svelte.d.ts +4 -3
  11. package/dist/components/CheckboxInactiveOrdersVault.svelte +20 -0
  12. package/dist/components/CheckboxInactiveOrdersVault.svelte.d.ts +19 -0
  13. package/dist/components/CheckboxMyItemsOnly.svelte +3 -2
  14. package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +2 -3
  15. package/dist/components/CheckboxZeroBalanceVault.svelte.d.ts +2 -2
  16. package/dist/components/CodeMirrorDotrain.svelte +4 -0
  17. package/dist/components/CodeMirrorDotrain.svelte.d.ts +1 -0
  18. package/dist/components/CodeMirrorRainlang.svelte +3 -12
  19. package/dist/components/CodeMirrorRainlang.svelte.d.ts +2 -2
  20. package/dist/components/EditableSpan.svelte +3 -14
  21. package/dist/components/EditableSpan.svelte.d.ts +0 -1
  22. package/dist/components/Hash.svelte +3 -3
  23. package/dist/components/License.svelte +5 -4
  24. package/dist/components/ListViewOrderbookFilters.svelte +45 -23
  25. package/dist/components/ListViewOrderbookFilters.svelte.d.ts +27 -22
  26. package/dist/components/LocalDbStatusBadge.svelte +27 -0
  27. package/dist/components/LocalDbStatusBadge.svelte.d.ts +19 -0
  28. package/dist/components/LocalDbStatusCard.svelte +40 -0
  29. package/dist/components/LocalDbStatusCard.svelte.d.ts +20 -0
  30. package/dist/components/LocalDbStatusModal.svelte +103 -0
  31. package/dist/components/LocalDbStatusModal.svelte.d.ts +21 -0
  32. package/dist/components/OrderOrVaultHash.svelte +12 -12
  33. package/dist/components/OrderOrVaultHash.svelte.d.ts +4 -4
  34. package/dist/components/PageHeader.svelte +1 -1
  35. package/dist/components/TanstackAppTable.svelte +179 -28
  36. package/dist/components/TanstackAppTable.svelte.d.ts +14 -8
  37. package/dist/components/ToastDetail.svelte +42 -0
  38. package/dist/components/ToastDetail.svelte.d.ts +20 -0
  39. package/dist/components/Tooltip.svelte +8 -0
  40. package/dist/components/Tooltip.svelte.d.ts +21 -0
  41. package/dist/components/VaultBalanceChangeTypeFilter.svelte +23 -0
  42. package/dist/components/VaultBalanceChangeTypeFilter.svelte.d.ts +19 -0
  43. package/dist/components/VaultCard.svelte +18 -0
  44. package/dist/components/VaultCard.svelte.d.ts +19 -0
  45. package/dist/components/charts/LightweightChart.svelte +1 -1
  46. package/dist/components/charts/LightweightChart.svelte.d.ts +5 -5
  47. package/dist/components/charts/OrderTradesChart.svelte +300 -28
  48. package/dist/components/charts/OrderTradesChart.svelte.d.ts +4 -4
  49. package/dist/components/charts/TanstackLightweightChartLine.svelte +5 -9
  50. package/dist/components/charts/VaultBalanceChart.svelte +8 -26
  51. package/dist/components/charts/VaultBalanceChart.svelte.d.ts +1 -7
  52. package/dist/components/charts/transformAndSortData.d.ts +24 -0
  53. package/dist/components/charts/transformAndSortData.js +111 -0
  54. package/dist/components/checkbox/CheckboxActiveOrders.svelte +11 -0
  55. package/dist/components/checkbox/CheckboxActiveOrders.svelte.d.ts +19 -0
  56. package/dist/components/deployment/ButtonSelectOption.svelte +2 -0
  57. package/dist/components/deployment/ButtonSelectOption.svelte.d.ts +1 -0
  58. package/dist/components/deployment/ComposedRainlangModal.svelte +2 -1
  59. package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +1 -4
  60. package/dist/components/deployment/DeploymentSectionHeader.svelte +7 -4
  61. package/dist/components/deployment/DeploymentSteps.svelte +209 -216
  62. package/dist/components/deployment/DeploymentSteps.svelte.d.ts +6 -12
  63. package/dist/components/deployment/DeploymentTile.svelte +2 -2
  64. package/dist/components/deployment/DeploymentTile.svelte.d.ts +1 -1
  65. package/dist/components/deployment/DeploymentsSection.svelte +15 -22
  66. package/dist/components/deployment/DeploymentsSection.svelte.d.ts +3 -2
  67. package/dist/components/deployment/DepositInput.svelte +8 -10
  68. package/dist/components/deployment/DepositInput.svelte.d.ts +1 -2
  69. package/dist/components/deployment/DisclaimerModal.svelte +6 -7
  70. package/dist/components/deployment/FieldDefinitionInput.svelte +7 -11
  71. package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +1 -2
  72. package/dist/components/deployment/InvalidOrdersSection.svelte +17 -0
  73. package/dist/components/deployment/InvalidOrdersSection.svelte.d.ts +19 -0
  74. package/dist/components/deployment/{StrategyPage.svelte → OrderPage.svelte} +15 -24
  75. package/dist/components/deployment/OrderPage.svelte.d.ts +21 -0
  76. package/dist/components/deployment/SelectToken.svelte +125 -48
  77. package/dist/components/deployment/SelectToken.svelte.d.ts +4 -3
  78. package/dist/components/deployment/TokenBalance.svelte +19 -0
  79. package/dist/components/deployment/TokenBalance.svelte.d.ts +19 -0
  80. package/dist/components/deployment/TokenIOInput.svelte +25 -15
  81. package/dist/components/deployment/TokenIOInput.svelte.d.ts +3 -3
  82. package/dist/components/deployment/TokenSelectionModal.svelte +148 -0
  83. package/dist/components/deployment/TokenSelectionModal.svelte.d.ts +20 -0
  84. package/dist/components/deployment/{ValidStrategiesSection.svelte → ValidOrdersSection.svelte} +7 -7
  85. package/dist/components/deployment/ValidOrdersSection.svelte.d.ts +19 -0
  86. package/dist/components/deployment/VaultIdInformation.svelte +17 -0
  87. package/dist/components/deployment/VaultIdInformation.svelte.d.ts +21 -0
  88. package/dist/components/detail/OrderDetail.svelte +184 -80
  89. package/dist/components/detail/OrderDetail.svelte.d.ts +21 -15
  90. package/dist/components/detail/TanstackOrderQuote.svelte +92 -46
  91. package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +14 -16
  92. package/dist/components/detail/VaultDetail.svelte +78 -77
  93. package/dist/components/detail/VaultDetail.svelte.d.ts +12 -18
  94. package/dist/components/dropdown/DropdownActiveNetworks.svelte +44 -0
  95. package/dist/components/dropdown/DropdownActiveNetworks.svelte.d.ts +19 -0
  96. package/dist/components/dropdown/DropdownCheckbox.svelte +4 -4
  97. package/dist/components/dropdown/DropdownOrderListAccounts.svelte +5 -2
  98. package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +2 -3
  99. package/dist/components/dropdown/DropdownOrderbooksFilter.svelte +172 -0
  100. package/dist/components/dropdown/DropdownOrderbooksFilter.svelte.d.ts +25 -0
  101. package/dist/components/dropdown/DropdownTokensFilter.svelte +152 -0
  102. package/dist/components/dropdown/DropdownTokensFilter.svelte.d.ts +28 -0
  103. package/dist/components/icon/Refresh.svelte +2 -1
  104. package/dist/components/icon/Refresh.svelte.d.ts +1 -0
  105. package/dist/components/input/InputOrderHash.svelte +1 -1
  106. package/dist/components/input/InputOrderHash.svelte.d.ts +3 -3
  107. package/dist/components/input/InputRegistryUrl.svelte +36 -14
  108. package/dist/components/input/InputToken.svelte +2 -2
  109. package/dist/components/input/InputTokenAmount.svelte +16 -21
  110. package/dist/components/input/InputTokenAmount.svelte.d.ts +3 -3
  111. package/dist/components/tables/OrderAPY.svelte +6 -33
  112. package/dist/components/tables/OrderAPY.svelte.d.ts +1 -4
  113. package/dist/components/tables/OrderTradesListTable.svelte +84 -81
  114. package/dist/components/tables/OrderTradesListTable.svelte.d.ts +4 -4
  115. package/dist/components/tables/OrderVaultsVolTable.svelte +17 -22
  116. package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +2 -2
  117. package/dist/components/tables/OrdersListTable.svelte +200 -108
  118. package/dist/components/tables/OrdersListTable.svelte.d.ts +17 -21
  119. package/dist/components/tables/VaultBalanceChangesTable.svelte +83 -43
  120. package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +13 -11
  121. package/dist/components/tables/VaultsListTable.svelte +268 -145
  122. package/dist/components/tables/VaultsListTable.svelte.d.ts +24 -32
  123. package/dist/components/transactions/FixedBottomTransaction.svelte +63 -0
  124. package/dist/components/transactions/FixedBottomTransaction.svelte.d.ts +16 -0
  125. package/dist/components/transactions/TransactionDetail.svelte +31 -0
  126. package/dist/components/transactions/TransactionDetail.svelte.d.ts +20 -0
  127. package/dist/components/transactions/TransactionList.svelte +17 -0
  128. package/dist/components/transactions/TransactionList.svelte.d.ts +16 -0
  129. package/dist/components/transactions/getStatusEmoji.d.ts +2 -0
  130. package/dist/components/transactions/getStatusEmoji.js +20 -0
  131. package/dist/components/wallet/WalletConnect.svelte +5 -4
  132. package/dist/components/wallet/WalletConnect.svelte.d.ts +0 -1
  133. package/dist/consts.d.ts +1 -0
  134. package/dist/consts.js +1 -0
  135. package/dist/errors/DeploymentStepsError.d.ts +8 -2
  136. package/dist/errors/DeploymentStepsError.js +7 -1
  137. package/dist/hooks/useGui.d.ts +1 -1
  138. package/dist/hooks/useGui.js +1 -1
  139. package/dist/hooks/useLocalDb.d.ts +3 -0
  140. package/dist/hooks/useLocalDb.js +10 -0
  141. package/dist/hooks/useRaindexClient.d.ts +3 -0
  142. package/dist/hooks/useRaindexClient.js +11 -0
  143. package/dist/index.d.ts +42 -19
  144. package/dist/index.js +41 -16
  145. package/dist/models/Transaction.d.ts +75 -0
  146. package/dist/models/Transaction.js +100 -0
  147. package/dist/providers/GuiProvider.svelte +1 -1
  148. package/dist/providers/GuiProvider.svelte.d.ts +1 -1
  149. package/dist/providers/LocalDbProvider.svelte +8 -0
  150. package/dist/providers/LocalDbProvider.svelte.d.ts +21 -0
  151. package/dist/providers/RaindexClientProvider.svelte +8 -0
  152. package/dist/providers/RaindexClientProvider.svelte.d.ts +21 -0
  153. package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte +8 -0
  154. package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte.d.ts +24 -0
  155. package/dist/providers/dotrainRegistry/context.d.ts +9 -0
  156. package/dist/providers/dotrainRegistry/context.js +40 -0
  157. package/dist/providers/dotrainRegistry/useDotrainRegistry.d.ts +5 -0
  158. package/dist/providers/dotrainRegistry/useDotrainRegistry.js +35 -0
  159. package/dist/providers/registry/RegistryManager.d.ts +65 -0
  160. package/dist/providers/registry/RegistryManager.js +133 -0
  161. package/dist/providers/registry/RegistryProvider.svelte +6 -0
  162. package/dist/providers/registry/RegistryProvider.svelte.d.ts +21 -0
  163. package/dist/providers/registry/context.d.ts +10 -0
  164. package/dist/providers/registry/context.js +46 -0
  165. package/dist/providers/registry/useRegistry.d.ts +7 -0
  166. package/dist/providers/registry/useRegistry.js +29 -0
  167. package/dist/providers/toasts/ToastProvider.svelte +17 -0
  168. package/dist/providers/toasts/ToastProvider.svelte.d.ts +18 -0
  169. package/dist/providers/toasts/context.d.ts +14 -0
  170. package/dist/providers/toasts/context.js +22 -0
  171. package/dist/providers/toasts/useToasts.d.ts +16 -0
  172. package/dist/providers/toasts/useToasts.js +63 -0
  173. package/dist/providers/transactions/TransactionManager.d.ts +235 -0
  174. package/dist/providers/transactions/TransactionManager.js +509 -0
  175. package/dist/providers/transactions/TransactionProvider.svelte +11 -0
  176. package/dist/providers/transactions/TransactionProvider.svelte.d.ts +24 -0
  177. package/dist/providers/transactions/context.d.ts +19 -0
  178. package/dist/providers/transactions/context.js +28 -0
  179. package/dist/providers/transactions/useTransactions.d.ts +13 -0
  180. package/dist/providers/transactions/useTransactions.js +18 -0
  181. package/dist/providers/wallet/WalletProvider.svelte +7 -0
  182. package/dist/providers/wallet/WalletProvider.svelte.d.ts +21 -0
  183. package/dist/providers/wallet/context.d.ts +10 -0
  184. package/dist/providers/wallet/context.js +47 -0
  185. package/dist/providers/wallet/useAccount.d.ts +8 -0
  186. package/dist/providers/wallet/useAccount.js +148 -0
  187. package/dist/queries/keys.d.ts +1 -0
  188. package/dist/queries/keys.js +1 -0
  189. package/dist/queries/queryClient.d.ts +1 -1
  190. package/dist/queries/queryClient.js +11 -6
  191. package/dist/services/awaitTransactionIndexing.d.ts +107 -0
  192. package/dist/services/awaitTransactionIndexing.js +58 -0
  193. package/dist/services/getExplorerLink.d.ts +1 -1
  194. package/dist/services/getExplorerLink.js +2 -4
  195. package/dist/services/handleShareChoices.d.ts +2 -2
  196. package/dist/services/handleShareChoices.js +7 -2
  197. package/dist/services/historicalOrderCharts.d.ts +2 -2
  198. package/dist/services/historicalOrderCharts.js +267 -333
  199. package/dist/services/index.d.ts +2 -1
  200. package/dist/services/index.js +2 -1
  201. package/dist/services/loadRegistryUrl.d.ts +2 -0
  202. package/dist/services/loadRegistryUrl.js +22 -0
  203. package/dist/services/pairTradesChartData.d.ts +47 -0
  204. package/dist/services/pairTradesChartData.js +190 -0
  205. package/dist/services/registry.d.ts +5 -5
  206. package/dist/services/registry.js +8 -208
  207. package/dist/services/time.d.ts +12 -0
  208. package/dist/services/time.js +88 -6
  209. package/dist/storesGeneric/cachedWritableStore.d.ts +57 -0
  210. package/dist/storesGeneric/cachedWritableStore.js +93 -0
  211. package/dist/types/account.d.ts +3 -0
  212. package/dist/types/appStores.d.ts +9 -14
  213. package/dist/types/modal.d.ts +26 -14
  214. package/dist/types/{strategy.d.ts → order.d.ts} +3 -3
  215. package/dist/types/order.js +1 -0
  216. package/dist/types/toast.d.ts +11 -0
  217. package/dist/types/toast.js +1 -0
  218. package/dist/types/tokenBalance.d.ts +6 -0
  219. package/dist/types/tokenBalance.js +1 -0
  220. package/dist/types/transaction.d.ts +66 -21
  221. package/dist/types/transaction.js +31 -1
  222. package/dist/utils/configHelpers.d.ts +4 -0
  223. package/dist/utils/configHelpers.js +21 -0
  224. package/dist/utils/constructHashLink.d.ts +24 -0
  225. package/dist/utils/constructHashLink.js +115 -0
  226. package/dist/utils/getNetworkName.d.ts +1 -0
  227. package/dist/utils/getNetworkName.js +13 -0
  228. package/dist/utils/number.d.ts +0 -7
  229. package/dist/utils/number.js +0 -27
  230. package/dist/utils/tokens.d.ts +2 -0
  231. package/dist/utils/tokens.js +3 -0
  232. package/dist/utils/vaultBalanceChangeLabels.d.ts +4 -0
  233. package/dist/utils/vaultBalanceChangeLabels.js +18 -0
  234. package/package.json +39 -34
  235. package/dist/__fixtures__/orderDetail.d.ts +0 -99
  236. package/dist/__fixtures__/orderDetail.js +0 -204
  237. package/dist/__fixtures__/settings-12-11-24.json +0 -160
  238. package/dist/__mocks__/mockTransactionStore.d.ts +0 -22
  239. package/dist/__mocks__/mockTransactionStore.js +0 -56
  240. package/dist/__mocks__/settings.d.ts +0 -3
  241. package/dist/__mocks__/settings.js +0 -37
  242. package/dist/components/deployment/InvalidStrategiesSection.svelte +0 -19
  243. package/dist/components/deployment/InvalidStrategiesSection.svelte.d.ts +0 -19
  244. package/dist/components/deployment/StrategyPage.svelte.d.ts +0 -19
  245. package/dist/components/deployment/ValidStrategiesSection.svelte.d.ts +0 -19
  246. package/dist/components/deployment/getDeploymentTransactionArgs.d.ts +0 -17
  247. package/dist/components/deployment/getDeploymentTransactionArgs.js +0 -28
  248. package/dist/components/detail/DepositOrWithdrawButtons.svelte +0 -44
  249. package/dist/components/detail/DepositOrWithdrawButtons.svelte.d.ts +0 -26
  250. package/dist/components/dropdown/DropdownActiveSubgraphs.svelte +0 -38
  251. package/dist/components/dropdown/DropdownActiveSubgraphs.svelte.d.ts +0 -21
  252. package/dist/components/dropdown/DropdownOrderStatus.svelte +0 -31
  253. package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +0 -19
  254. package/dist/stores/transactionStore.d.ts +0 -98
  255. package/dist/stores/transactionStore.js +0 -303
  256. package/dist/utils/time.d.ts +0 -12
  257. package/dist/utils/time.js +0 -27
  258. package/dist/utils/vault.d.ts +0 -2
  259. package/dist/utils/vault.js +0 -29
  260. /package/dist/types/{strategy.js → account.js} +0 -0
@@ -1,13 +1,12 @@
1
- import { timestampSecondsToUTCTimestamp } from '../utils/time';
1
+ import { timestampSecondsToUTCTimestamp } from '../services/time';
2
2
  import { sortBy } from 'lodash';
3
- import { formatUnits } from 'viem';
4
3
  export function prepareHistoricalOrderChartData(takeOrderEntities, colorTheme) {
5
4
  const transformedData = takeOrderEntities.map((d) => ({
6
- value: Math.abs(Number(formatUnits(BigInt(d.inputVaultBalanceChange.amount), Number(d.inputVaultBalanceChange.vault.token.decimals ?? 0))) /
7
- Number(formatUnits(BigInt(d.outputVaultBalanceChange.amount), Number(d.outputVaultBalanceChange.vault.token.decimals ?? 0)))),
5
+ value: Math.abs(Number(d.inputVaultBalanceChange.formattedAmount) /
6
+ Number(d.outputVaultBalanceChange.formattedAmount)),
8
7
  time: timestampSecondsToUTCTimestamp(BigInt(d.timestamp)),
9
8
  color: colorTheme == 'dark' ? '#5178FF' : '#4E4AF6',
10
- outputAmount: +d.outputVaultBalanceChange.amount
9
+ outputAmount: Number(d.outputVaultBalanceChange.amount)
11
10
  }));
12
11
  // if we have multiple object in the array with the same timestamp, we need to merge them
13
12
  // we do this by taking the weighted average of the ioratio values for objects that share the same timestamp.
@@ -38,219 +37,189 @@ if (import.meta.vitest) {
38
37
  const takeOrderEntities = [
39
38
  {
40
39
  id: '1',
41
- timestamp: '1632000000',
42
- tradeEvent: {
43
- sender: 'sender_address',
44
- transaction: {
45
- id: 'transaction_id',
46
- from: 'sender_address',
47
- timestamp: '1632000000',
48
- blockNumber: '0'
49
- }
40
+ timestamp: BigInt(1632000000),
41
+ transaction: {
42
+ id: 'transaction_id',
43
+ from: '0xsender_address',
44
+ timestamp: BigInt(1632000000),
45
+ blockNumber: BigInt(0)
50
46
  },
51
47
  outputVaultBalanceChange: {
52
- amount: '100',
53
- vault: {
54
- id: '1',
55
- vaultId: 'vault-id1',
56
- token: {
57
- id: 'output_token',
58
- address: 'output_token',
59
- name: 'output_token',
60
- symbol: 'output_token',
61
- decimals: '1'
62
- }
63
- },
64
- id: '1',
48
+ amount: BigInt(100),
49
+ formattedAmount: '100',
50
+ vaultId: BigInt(1),
65
51
  __typename: 'Withdraw',
66
- newVaultBalance: '0',
67
- oldVaultBalance: '0',
68
- timestamp: '0',
52
+ token: {
53
+ id: 'output_token',
54
+ address: '0xoutput_token',
55
+ name: 'output_token',
56
+ symbol: 'output_token',
57
+ decimals: BigInt(1)
58
+ },
59
+ newBalance: BigInt(0),
60
+ formattedNewBalance: '0',
61
+ oldBalance: BigInt(0),
62
+ formattedOldBalance: '0',
63
+ timestamp: BigInt(0),
69
64
  transaction: {
70
65
  id: 'transaction_id',
71
66
  from: 'sender_address',
72
- timestamp: '1632000000',
73
- blockNumber: '0'
67
+ timestamp: BigInt(1632000000),
68
+ blockNumber: BigInt(0)
74
69
  },
75
- orderbook: { id: '1' }
76
- },
77
- order: {
78
- id: 'order_id',
79
- orderHash: 'orderHash'
70
+ orderbook: '0x1'
80
71
  },
72
+ orderHash: 'orderHash',
81
73
  inputVaultBalanceChange: {
82
- vault: {
83
- id: '1',
84
- vaultId: 'vault-id1',
85
- token: {
86
- id: 'output_token',
87
- address: 'output_token',
88
- name: 'output_token',
89
- symbol: 'output_token',
90
- decimals: '1'
91
- }
74
+ vaultId: BigInt(1),
75
+ token: {
76
+ id: 'output_token',
77
+ address: '0xoutput_token',
78
+ name: 'output_token',
79
+ symbol: 'output_token',
80
+ decimals: BigInt(1)
92
81
  },
93
- amount: '50',
94
- id: '1',
82
+ amount: BigInt(50),
83
+ formattedAmount: '50',
95
84
  __typename: 'Withdraw',
96
- newVaultBalance: '0',
97
- oldVaultBalance: '0',
98
- timestamp: '0',
85
+ newBalance: BigInt(0),
86
+ formattedNewBalance: '0',
87
+ oldBalance: BigInt(0),
88
+ formattedOldBalance: '0',
89
+ timestamp: BigInt(0),
99
90
  transaction: {
100
91
  id: 'transaction_id',
101
- from: 'sender_address',
102
- timestamp: '1632000000',
103
- blockNumber: '0'
92
+ from: '0xsender_address',
93
+ timestamp: BigInt(1632000000),
94
+ blockNumber: BigInt(0)
104
95
  },
105
- orderbook: { id: '1' }
96
+ orderbook: '0x1'
106
97
  },
107
- orderbook: {
108
- id: '0x00'
109
- }
98
+ orderbook: '0x00'
110
99
  },
111
100
  {
112
101
  id: '2',
113
- timestamp: '1631000000',
114
- tradeEvent: {
115
- sender: 'sender_address',
116
- transaction: {
117
- id: 'transaction_id',
118
- from: 'sender_address',
119
- timestamp: '1631000000',
120
- blockNumber: '0'
121
- }
102
+ timestamp: BigInt(1631000000),
103
+ transaction: {
104
+ id: 'transaction_id',
105
+ from: '0xsender_address',
106
+ timestamp: BigInt(1631000000),
107
+ blockNumber: BigInt(0)
122
108
  },
123
109
  outputVaultBalanceChange: {
124
- amount: '100',
125
- vault: {
126
- id: '1',
127
- vaultId: 'vault-id1',
128
- token: {
129
- id: 'output_token',
130
- address: 'output_token',
131
- name: 'output_token',
132
- symbol: 'output_token',
133
- decimals: '1'
134
- }
110
+ amount: BigInt(100),
111
+ formattedAmount: '100',
112
+ vaultId: BigInt(1),
113
+ token: {
114
+ id: 'output_token',
115
+ address: '0xoutput_token',
116
+ name: 'output_token',
117
+ symbol: 'output_token',
118
+ decimals: BigInt(1)
135
119
  },
136
- id: '1',
120
+ newBalance: BigInt(0),
121
+ formattedNewBalance: '0',
122
+ oldBalance: BigInt(0),
123
+ formattedOldBalance: '0',
137
124
  __typename: 'Withdraw',
138
- newVaultBalance: '0',
139
- oldVaultBalance: '0',
140
- timestamp: '0',
125
+ timestamp: BigInt(0),
141
126
  transaction: {
142
127
  id: 'transaction_id',
143
- from: 'sender_address',
144
- timestamp: '1632000000',
145
- blockNumber: '0'
128
+ from: '0xsender_address',
129
+ timestamp: BigInt(1632000000),
130
+ blockNumber: BigInt(0)
146
131
  },
147
- orderbook: { id: '1' }
148
- },
149
- order: {
150
- id: 'order_id',
151
- orderHash: 'orderHash'
132
+ orderbook: '0x1'
152
133
  },
134
+ orderHash: 'orderHash',
153
135
  inputVaultBalanceChange: {
154
- vault: {
155
- id: '1',
156
- vaultId: 'vault-id1',
157
- token: {
158
- id: 'output_token',
159
- address: 'output_token',
160
- name: 'output_token',
161
- symbol: 'output_token',
162
- decimals: '1'
163
- }
136
+ vaultId: BigInt(1),
137
+ token: {
138
+ id: 'output_token',
139
+ address: '0xoutput_token',
140
+ name: 'output_token',
141
+ symbol: 'output_token',
142
+ decimals: BigInt(1)
164
143
  },
165
- amount: '50',
166
- id: '1',
144
+ amount: BigInt(50),
145
+ formattedAmount: '50',
167
146
  __typename: 'Withdraw',
168
- newVaultBalance: '0',
169
- oldVaultBalance: '0',
170
- timestamp: '0',
147
+ newBalance: BigInt(0),
148
+ formattedNewBalance: '0',
149
+ oldBalance: BigInt(0),
150
+ formattedOldBalance: '0',
151
+ timestamp: BigInt(0),
171
152
  transaction: {
172
153
  id: 'transaction_id',
173
- from: 'sender_address',
174
- timestamp: '1632000000',
175
- blockNumber: '0'
154
+ from: '0xsender_address',
155
+ timestamp: BigInt(1632000000),
156
+ blockNumber: BigInt(0)
176
157
  },
177
- orderbook: { id: '1' }
158
+ orderbook: '0x1'
178
159
  },
179
- orderbook: {
180
- id: '0x00'
181
- }
160
+ orderbook: '0x00'
182
161
  },
183
162
  {
184
163
  id: '3',
185
- timestamp: '1630000000',
186
- tradeEvent: {
187
- sender: 'sender_address',
188
- transaction: {
189
- id: 'transaction_id',
190
- from: 'sender_address',
191
- timestamp: '1630000000',
192
- blockNumber: '0'
193
- }
164
+ timestamp: BigInt(1630000000),
165
+ transaction: {
166
+ id: 'transaction_id',
167
+ from: '0xsender_address',
168
+ timestamp: BigInt(1630000000),
169
+ blockNumber: BigInt(0)
194
170
  },
195
171
  outputVaultBalanceChange: {
196
- amount: '100',
197
- vault: {
198
- id: '1',
199
- vaultId: 'vault-id1',
200
- token: {
201
- id: 'output_token',
202
- address: 'output_token',
203
- name: 'output_token',
204
- symbol: 'output_token',
205
- decimals: '1'
206
- }
172
+ amount: BigInt(100),
173
+ formattedAmount: '100',
174
+ vaultId: BigInt(1),
175
+ token: {
176
+ id: 'output_token',
177
+ address: '0xoutput_token',
178
+ name: 'output_token',
179
+ symbol: 'output_token',
180
+ decimals: BigInt(1)
207
181
  },
208
- id: '1',
182
+ newBalance: BigInt(0),
183
+ formattedNewBalance: '0',
184
+ oldBalance: BigInt(0),
185
+ formattedOldBalance: '0',
209
186
  __typename: 'Withdraw',
210
- newVaultBalance: '0',
211
- oldVaultBalance: '0',
212
- timestamp: '0',
187
+ timestamp: BigInt(0),
213
188
  transaction: {
214
189
  id: 'transaction_id',
215
190
  from: 'sender_address',
216
- timestamp: '1632000000',
217
- blockNumber: '0'
191
+ timestamp: BigInt(1632000000),
192
+ blockNumber: BigInt(0)
218
193
  },
219
- orderbook: { id: '1' }
220
- },
221
- order: {
222
- id: 'order_id',
223
- orderHash: 'orderHash'
194
+ orderbook: '0x1'
224
195
  },
196
+ orderHash: 'orderHash',
225
197
  inputVaultBalanceChange: {
226
- vault: {
227
- id: '1',
228
- vaultId: 'vault-id1',
229
- token: {
230
- id: 'output_token',
231
- address: 'output_token',
232
- name: 'output_token',
233
- symbol: 'output_token',
234
- decimals: '1'
235
- }
198
+ vaultId: BigInt(1),
199
+ token: {
200
+ id: 'output_token',
201
+ address: '0xoutput_token',
202
+ name: 'output_token',
203
+ symbol: 'output_token',
204
+ decimals: BigInt(1)
236
205
  },
237
- amount: '50',
238
- id: '1',
206
+ newBalance: BigInt(0),
207
+ formattedNewBalance: '0',
208
+ oldBalance: BigInt(0),
209
+ formattedOldBalance: '0',
210
+ amount: BigInt(50),
211
+ formattedAmount: '50',
239
212
  __typename: 'Withdraw',
240
- newVaultBalance: '0',
241
- oldVaultBalance: '0',
242
- timestamp: '0',
213
+ timestamp: BigInt(0),
243
214
  transaction: {
244
215
  id: 'transaction_id',
245
216
  from: 'sender_address',
246
- timestamp: '1632000000',
247
- blockNumber: '0'
217
+ timestamp: BigInt(1632000000),
218
+ blockNumber: BigInt(0)
248
219
  },
249
- orderbook: { id: '1' }
220
+ orderbook: '0x1'
250
221
  },
251
- orderbook: {
252
- id: '0x00'
253
- }
222
+ orderbook: '0x00'
254
223
  }
255
224
  ];
256
225
  const result = prepareHistoricalOrderChartData(takeOrderEntities, 'dark');
@@ -270,219 +239,184 @@ if (import.meta.vitest) {
270
239
  const takeOrderEntities = [
271
240
  {
272
241
  id: '1',
273
- timestamp: '1632000000',
274
- tradeEvent: {
275
- sender: 'sender_address',
276
- transaction: {
277
- id: 'transaction_id',
278
- from: 'sender_address',
279
- timestamp: '1632000000',
280
- blockNumber: '0'
281
- }
242
+ timestamp: BigInt(1632000000),
243
+ transaction: {
244
+ id: 'transaction_id',
245
+ from: '0xsender_address',
246
+ timestamp: BigInt(1632000000),
247
+ blockNumber: BigInt(0)
282
248
  },
283
249
  outputVaultBalanceChange: {
284
- amount: '100',
285
- vault: {
286
- id: '1',
287
- vaultId: 'vault-id1',
288
- token: {
289
- id: 'output_token',
290
- address: 'output_token',
291
- name: 'output_token',
292
- symbol: 'output_token',
293
- decimals: '1'
294
- }
250
+ amount: BigInt(100),
251
+ formattedAmount: '100',
252
+ vaultId: BigInt(1),
253
+ token: {
254
+ id: 'output_token',
255
+ address: '0xoutput_token',
256
+ name: 'output_token',
257
+ symbol: 'output_token',
258
+ decimals: BigInt(1)
295
259
  },
296
- id: '1',
297
- __typename: 'Withdraw',
298
- newVaultBalance: '0',
299
- oldVaultBalance: '0',
300
- timestamp: '0',
260
+ newBalance: BigInt(0),
261
+ formattedNewBalance: '0',
262
+ oldBalance: BigInt(0),
263
+ formattedOldBalance: '0',
264
+ timestamp: BigInt(0),
301
265
  transaction: {
302
266
  id: 'transaction_id',
303
- from: 'sender_address',
304
- timestamp: '1632000000',
305
- blockNumber: '0'
267
+ from: '0xsender_address',
268
+ timestamp: BigInt(1632000000),
269
+ blockNumber: BigInt(0)
306
270
  },
307
- orderbook: { id: '1' }
308
- },
309
- order: {
310
- id: 'order_id',
311
- orderHash: 'orderHash'
271
+ __typename: 'Withdraw',
272
+ orderbook: '0x1'
312
273
  },
274
+ orderHash: 'orderHash',
313
275
  inputVaultBalanceChange: {
314
- vault: {
315
- id: '1',
316
- vaultId: 'vault-id1',
317
- token: {
318
- id: 'output_token',
319
- address: 'output_token',
320
- name: 'output_token',
321
- symbol: 'output_token',
322
- decimals: '1'
323
- }
276
+ vaultId: BigInt(1),
277
+ token: {
278
+ id: 'output_token',
279
+ address: '0xoutput_token',
280
+ name: 'output_token',
281
+ symbol: 'output_token',
282
+ decimals: BigInt(1)
324
283
  },
325
- amount: '50',
326
- id: '1',
327
- __typename: 'Withdraw',
328
- newVaultBalance: '0',
329
- oldVaultBalance: '0',
330
- timestamp: '0',
284
+ amount: BigInt(50),
285
+ formattedAmount: '50',
286
+ newBalance: BigInt(0),
287
+ formattedNewBalance: '0',
288
+ oldBalance: BigInt(0),
289
+ formattedOldBalance: '0',
290
+ timestamp: BigInt(0),
331
291
  transaction: {
332
292
  id: 'transaction_id',
333
- from: 'sender_address',
334
- timestamp: '1632000000',
335
- blockNumber: '0'
293
+ from: '0xsender_address',
294
+ timestamp: BigInt(1632000000),
295
+ blockNumber: BigInt(0)
336
296
  },
337
- orderbook: { id: '1' }
297
+ orderbook: '0x1'
338
298
  },
339
- orderbook: {
340
- id: '0x00'
341
- }
299
+ orderbook: '0x00'
342
300
  },
343
301
  {
344
302
  id: '2',
345
- timestamp: '1632000000',
346
- tradeEvent: {
347
- sender: 'sender_address',
348
- transaction: {
349
- id: 'transaction_id',
350
- from: 'sender_address',
351
- timestamp: '1632000000',
352
- blockNumber: '0'
353
- }
303
+ timestamp: BigInt(1632000000),
304
+ transaction: {
305
+ id: 'transaction_id',
306
+ from: '0xsender_address',
307
+ timestamp: BigInt(1632000000),
308
+ blockNumber: BigInt(0)
354
309
  },
355
310
  outputVaultBalanceChange: {
356
- amount: '200',
357
- vault: {
358
- id: '1',
359
- vaultId: 'vault-id1',
360
- token: {
361
- id: 'output_token',
362
- address: 'output_token',
363
- name: 'output_token',
364
- symbol: 'output_token',
365
- decimals: '1'
366
- }
311
+ amount: BigInt(200),
312
+ formattedAmount: '200',
313
+ vaultId: BigInt(1),
314
+ token: {
315
+ id: 'output_token',
316
+ address: '0xoutput_token',
317
+ name: 'output_token',
318
+ symbol: 'output_token',
319
+ decimals: BigInt(1)
367
320
  },
368
- id: '1',
369
- __typename: 'Withdraw',
370
- newVaultBalance: '0',
371
- oldVaultBalance: '0',
372
- timestamp: '0',
321
+ newBalance: BigInt(0),
322
+ formattedNewBalance: '0',
323
+ oldBalance: BigInt(0),
324
+ formattedOldBalance: '0',
325
+ timestamp: BigInt(0),
373
326
  transaction: {
374
327
  id: 'transaction_id',
375
- from: 'sender_address',
376
- timestamp: '1632000000',
377
- blockNumber: '0'
328
+ from: '0xsender_address',
329
+ timestamp: BigInt(1632000000),
330
+ blockNumber: BigInt(0)
378
331
  },
379
- orderbook: { id: '1' }
380
- },
381
- order: {
382
- id: 'order_id',
383
- orderHash: 'orderHash'
332
+ orderbook: '0x1'
384
333
  },
334
+ orderHash: 'orderHash',
385
335
  inputVaultBalanceChange: {
386
- vault: {
387
- id: '1',
388
- vaultId: 'vault-id1',
389
- token: {
390
- id: 'output_token',
391
- address: 'output_token',
392
- name: 'output_token',
393
- symbol: 'output_token',
394
- decimals: '1'
395
- }
336
+ vaultId: BigInt(1),
337
+ token: {
338
+ id: 'output_token',
339
+ address: '0xoutput_token',
340
+ name: 'output_token',
341
+ symbol: 'output_token',
342
+ decimals: BigInt(1)
396
343
  },
397
- amount: '50',
398
- id: '1',
399
- __typename: 'Withdraw',
400
- newVaultBalance: '0',
401
- oldVaultBalance: '0',
402
- timestamp: '0',
344
+ amount: BigInt(50),
345
+ formattedAmount: '50',
346
+ newBalance: BigInt(0),
347
+ formattedNewBalance: '0',
348
+ oldBalance: BigInt(0),
349
+ formattedOldBalance: '0',
350
+ timestamp: BigInt(0),
403
351
  transaction: {
404
352
  id: 'transaction_id',
405
- from: 'sender_address',
406
- timestamp: '1632000000',
407
- blockNumber: '0'
353
+ from: '0xsender_address',
354
+ timestamp: BigInt(1632000000),
355
+ blockNumber: BigInt(0)
408
356
  },
409
- orderbook: { id: '1' }
357
+ orderbook: '0x1'
410
358
  },
411
- orderbook: {
412
- id: '0x00'
413
- }
359
+ orderbook: '0x00'
414
360
  },
415
361
  {
416
362
  id: '3',
417
- timestamp: '1632000000',
418
- tradeEvent: {
419
- sender: 'sender_address',
420
- transaction: {
421
- id: 'transaction_id',
422
- from: 'sender_address',
423
- timestamp: '1632000000',
424
- blockNumber: '0'
425
- }
363
+ timestamp: BigInt(1632000000),
364
+ transaction: {
365
+ id: 'transaction_id',
366
+ from: '0xsender_address',
367
+ timestamp: BigInt(1632000000),
368
+ blockNumber: BigInt(0)
426
369
  },
427
370
  outputVaultBalanceChange: {
428
- amount: '400',
429
- vault: {
430
- id: '1',
431
- vaultId: 'vault-id1',
432
- token: {
433
- id: 'output_token',
434
- address: 'output_token',
435
- name: 'output_token',
436
- symbol: 'output_token',
437
- decimals: '1'
438
- }
371
+ amount: BigInt(400),
372
+ formattedAmount: '400',
373
+ vaultId: BigInt(1),
374
+ token: {
375
+ id: 'output_token',
376
+ address: '0xoutput_token',
377
+ name: 'output_token',
378
+ symbol: 'output_token',
379
+ decimals: BigInt(1)
439
380
  },
440
- id: '1',
441
- __typename: 'Withdraw',
442
- newVaultBalance: '0',
443
- oldVaultBalance: '0',
444
- timestamp: '0',
381
+ newBalance: BigInt(0),
382
+ formattedNewBalance: '0',
383
+ oldBalance: BigInt(0),
384
+ formattedOldBalance: '0',
385
+ timestamp: BigInt(0),
445
386
  transaction: {
446
387
  id: 'transaction_id',
447
- from: 'sender_address',
448
- timestamp: '1632000000',
449
- blockNumber: '0'
388
+ from: '0xsender_address',
389
+ timestamp: BigInt(1632000000),
390
+ blockNumber: BigInt(0)
450
391
  },
451
- orderbook: { id: '1' }
452
- },
453
- order: {
454
- id: 'order_id',
455
- orderHash: 'orderHash'
392
+ orderbook: '0x1'
456
393
  },
394
+ orderHash: 'orderHash',
457
395
  inputVaultBalanceChange: {
458
- vault: {
459
- id: '1',
460
- vaultId: 'vault-id1',
461
- token: {
462
- id: 'output_token',
463
- address: 'output_token',
464
- name: 'output_token',
465
- symbol: 'output_token',
466
- decimals: '1'
467
- }
396
+ vaultId: BigInt(1),
397
+ token: {
398
+ id: 'output_token_id',
399
+ address: '0xoutput_token',
400
+ name: 'output_token',
401
+ symbol: 'output_token',
402
+ decimals: BigInt(1)
468
403
  },
469
- amount: '50',
470
- id: '1',
471
- __typename: 'Withdraw',
472
- newVaultBalance: '0',
473
- oldVaultBalance: '0',
474
- timestamp: '0',
404
+ amount: BigInt(50),
405
+ formattedAmount: '50',
406
+ newBalance: BigInt(0),
407
+ formattedNewBalance: '0',
408
+ oldBalance: BigInt(0),
409
+ formattedOldBalance: '0',
410
+ timestamp: BigInt(0),
475
411
  transaction: {
476
412
  id: 'transaction_id',
477
- from: 'sender_address',
478
- timestamp: '1632000000',
479
- blockNumber: '0'
413
+ from: '0xsender_address',
414
+ timestamp: BigInt(1632000000),
415
+ blockNumber: BigInt(0)
480
416
  },
481
- orderbook: { id: '1' }
417
+ orderbook: '0x1'
482
418
  },
483
- orderbook: {
484
- id: '0x00'
485
- }
419
+ orderbook: '0x00'
486
420
  }
487
421
  ];
488
422
  const result = prepareHistoricalOrderChartData(takeOrderEntities, 'dark');