@rainlanguage/ui-components 0.0.1-alpha.24 → 0.0.1-alpha.241

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 (299) hide show
  1. package/README.md +14 -6
  2. package/dist/__fixtures__/settings.yaml +123 -0
  3. package/dist/__mocks__/CodeMirrorRainlang.svelte +4 -0
  4. package/dist/__mocks__/CodeMirrorRainlang.svelte.d.ts +18 -0
  5. package/dist/__mocks__/MockCodeMirrorEditor.svelte +17 -0
  6. package/dist/__mocks__/MockCodeMirrorEditor.svelte.d.ts +21 -0
  7. package/dist/__mocks__/MockComponent.js +1 -1
  8. package/dist/__mocks__/MockComponent.svelte +10 -2
  9. package/dist/__mocks__/MockComponent.svelte.d.ts +4 -1
  10. package/dist/__mocks__/mockWeb3Config.d.ts +1 -1
  11. package/dist/__mocks__/mockWeb3Config.js +10 -7
  12. package/dist/__mocks__/queries.js +9 -9
  13. package/dist/__mocks__/stores.d.ts +55 -45
  14. package/dist/__mocks__/stores.js +85 -68
  15. package/dist/app.css +3 -3
  16. package/dist/components/ButtonDarkMode.svelte +7 -1
  17. package/dist/components/ButtonLoading.svelte +1 -1
  18. package/dist/components/ButtonScrub.svelte +22 -0
  19. package/dist/components/ButtonScrub.svelte.d.ts +25 -0
  20. package/dist/components/ButtonVaultLink.svelte +12 -11
  21. package/dist/components/ButtonVaultLink.svelte.d.ts +4 -3
  22. package/dist/components/CheckboxInactiveOrdersVault.svelte +20 -0
  23. package/dist/components/CheckboxInactiveOrdersVault.svelte.d.ts +19 -0
  24. package/dist/components/CheckboxZeroBalanceVault.svelte.d.ts +2 -2
  25. package/dist/components/CodeMirrorDotrain.svelte +4 -0
  26. package/dist/components/CodeMirrorDotrain.svelte.d.ts +1 -0
  27. package/dist/components/CodeMirrorRainlang.svelte +20 -12
  28. package/dist/components/CodeMirrorRainlang.svelte.d.ts +3 -2
  29. package/dist/components/EditableSpan.svelte +3 -14
  30. package/dist/components/EditableSpan.svelte.d.ts +0 -1
  31. package/dist/components/Hash.svelte +6 -5
  32. package/dist/components/License.svelte +5 -4
  33. package/dist/components/ListViewRaindexFilters.svelte +64 -0
  34. package/dist/components/ListViewRaindexFilters.svelte.d.ts +32 -0
  35. package/dist/components/LocalDbStatusBadge.svelte +27 -0
  36. package/dist/components/LocalDbStatusBadge.svelte.d.ts +19 -0
  37. package/dist/components/LocalDbStatusCard.svelte +43 -0
  38. package/dist/components/LocalDbStatusCard.svelte.d.ts +20 -0
  39. package/dist/components/LocalDbStatusModal.svelte +105 -0
  40. package/dist/components/LocalDbStatusModal.svelte.d.ts +21 -0
  41. package/dist/components/OrderOrVaultHash.svelte +12 -12
  42. package/dist/components/OrderOrVaultHash.svelte.d.ts +4 -4
  43. package/dist/components/PageHeader.svelte +1 -1
  44. package/dist/components/Sensitive.svelte +16 -0
  45. package/dist/components/Sensitive.svelte.d.ts +28 -0
  46. package/dist/components/TanstackAppTable.svelte +270 -60
  47. package/dist/components/TanstackAppTable.svelte.d.ts +15 -9
  48. package/dist/components/ToastDetail.svelte +42 -0
  49. package/dist/components/ToastDetail.svelte.d.ts +20 -0
  50. package/dist/components/Tooltip.svelte +8 -0
  51. package/dist/components/Tooltip.svelte.d.ts +21 -0
  52. package/dist/components/VaultBalanceChangeTypeFilter.svelte +23 -0
  53. package/dist/components/VaultBalanceChangeTypeFilter.svelte.d.ts +19 -0
  54. package/dist/components/VaultCard.svelte +18 -0
  55. package/dist/components/VaultCard.svelte.d.ts +19 -0
  56. package/dist/components/charts/LightweightChart.svelte +1 -1
  57. package/dist/components/charts/LightweightChart.svelte.d.ts +5 -5
  58. package/dist/components/charts/OrderTradesChart.svelte +319 -28
  59. package/dist/components/charts/OrderTradesChart.svelte.d.ts +4 -4
  60. package/dist/components/charts/TanstackLightweightChartLine.svelte +5 -9
  61. package/dist/components/charts/VaultBalanceChart.svelte +8 -26
  62. package/dist/components/charts/VaultBalanceChart.svelte.d.ts +1 -7
  63. package/dist/components/charts/transformAndSortData.d.ts +24 -0
  64. package/dist/components/charts/transformAndSortData.js +111 -0
  65. package/dist/components/checkbox/CheckboxActiveOrders.svelte +11 -0
  66. package/dist/components/checkbox/CheckboxActiveOrders.svelte.d.ts +19 -0
  67. package/dist/components/deployment/ButtonSelectOption.svelte +2 -0
  68. package/dist/components/deployment/ButtonSelectOption.svelte.d.ts +1 -0
  69. package/dist/components/deployment/ComposedRainlangModal.svelte +3 -2
  70. package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +1 -4
  71. package/dist/components/deployment/DeploymentSectionHeader.svelte +7 -4
  72. package/dist/components/deployment/DeploymentSteps.svelte +196 -221
  73. package/dist/components/deployment/DeploymentSteps.svelte.d.ts +6 -12
  74. package/dist/components/deployment/DeploymentTile.svelte +2 -2
  75. package/dist/components/deployment/DeploymentTile.svelte.d.ts +1 -1
  76. package/dist/components/deployment/DeploymentsSection.svelte +15 -22
  77. package/dist/components/deployment/DeploymentsSection.svelte.d.ts +3 -2
  78. package/dist/components/deployment/DepositInput.svelte +10 -11
  79. package/dist/components/deployment/DepositInput.svelte.d.ts +2 -3
  80. package/dist/components/deployment/DisclaimerModal.svelte +6 -7
  81. package/dist/components/deployment/FieldDefinitionInput.svelte +10 -14
  82. package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +2 -3
  83. package/dist/components/deployment/InvalidOrdersSection.svelte +17 -0
  84. package/dist/components/deployment/InvalidOrdersSection.svelte.d.ts +19 -0
  85. package/dist/components/deployment/{StrategyPage.svelte → OrderPage.svelte} +15 -24
  86. package/dist/components/deployment/OrderPage.svelte.d.ts +21 -0
  87. package/dist/components/deployment/SelectToken.svelte +127 -50
  88. package/dist/components/deployment/SelectToken.svelte.d.ts +5 -4
  89. package/dist/components/deployment/TokenBalance.svelte +19 -0
  90. package/dist/components/deployment/TokenBalance.svelte.d.ts +19 -0
  91. package/dist/components/deployment/TokenIOInput.svelte +27 -17
  92. package/dist/components/deployment/TokenIOInput.svelte.d.ts +3 -3
  93. package/dist/components/deployment/TokenSelectionModal.svelte +148 -0
  94. package/dist/components/deployment/TokenSelectionModal.svelte.d.ts +20 -0
  95. package/dist/components/deployment/{ValidStrategiesSection.svelte → ValidOrdersSection.svelte} +7 -7
  96. package/dist/components/deployment/ValidOrdersSection.svelte.d.ts +19 -0
  97. package/dist/components/deployment/VaultIdInformation.svelte +17 -0
  98. package/dist/components/deployment/VaultIdInformation.svelte.d.ts +21 -0
  99. package/dist/components/detail/OrderDetail.svelte +220 -82
  100. package/dist/components/detail/OrderDetail.svelte.d.ts +21 -15
  101. package/dist/components/detail/TanstackOrderQuote.svelte +114 -46
  102. package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +14 -16
  103. package/dist/components/detail/VaultDetail.svelte +82 -79
  104. package/dist/components/detail/VaultDetail.svelte.d.ts +12 -18
  105. package/dist/components/dropdown/DropdownActiveNetworks.svelte +44 -0
  106. package/dist/components/dropdown/DropdownActiveNetworks.svelte.d.ts +19 -0
  107. package/dist/components/dropdown/DropdownCheckbox.svelte +4 -4
  108. package/dist/components/dropdown/DropdownRaindexesFilter.svelte +172 -0
  109. package/dist/components/dropdown/DropdownRaindexesFilter.svelte.d.ts +25 -0
  110. package/dist/components/dropdown/DropdownTokensFilter.svelte +152 -0
  111. package/dist/components/dropdown/DropdownTokensFilter.svelte.d.ts +28 -0
  112. package/dist/components/icon/Refresh.svelte +4 -2
  113. package/dist/components/icon/Refresh.svelte.d.ts +2 -0
  114. package/dist/components/input/InputOrderHash.svelte +1 -1
  115. package/dist/components/input/InputOrderHash.svelte.d.ts +3 -3
  116. package/dist/components/input/InputOwnerFilter.svelte +48 -0
  117. package/dist/components/input/InputOwnerFilter.svelte.d.ts +19 -0
  118. package/dist/components/input/InputRegistryUrl.svelte +36 -14
  119. package/dist/components/input/InputToken.svelte +2 -2
  120. package/dist/components/input/InputTokenAmount.svelte +30 -20
  121. package/dist/components/input/InputTokenAmount.svelte.d.ts +3 -3
  122. package/dist/components/tables/OrderAPY.svelte +6 -33
  123. package/dist/components/tables/OrderAPY.svelte.d.ts +1 -4
  124. package/dist/components/tables/OrderTradesListTable.svelte +132 -124
  125. package/dist/components/tables/OrderTradesListTable.svelte.d.ts +4 -4
  126. package/dist/components/tables/OrderVaultsVolTable.svelte +17 -22
  127. package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +2 -2
  128. package/dist/components/tables/OrdersListTable.svelte +206 -115
  129. package/dist/components/tables/OrdersListTable.svelte.d.ts +18 -23
  130. package/dist/components/tables/VaultBalanceChangesTable.svelte +83 -43
  131. package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +13 -11
  132. package/dist/components/tables/VaultsListTable.svelte +275 -150
  133. package/dist/components/tables/VaultsListTable.svelte.d.ts +24 -33
  134. package/dist/components/transactions/FixedBottomTransaction.svelte +64 -0
  135. package/dist/components/transactions/FixedBottomTransaction.svelte.d.ts +16 -0
  136. package/dist/components/transactions/TransactionDetail.svelte +31 -0
  137. package/dist/components/transactions/TransactionDetail.svelte.d.ts +20 -0
  138. package/dist/components/transactions/TransactionList.svelte +17 -0
  139. package/dist/components/transactions/TransactionList.svelte.d.ts +16 -0
  140. package/dist/components/transactions/getStatusEmoji.d.ts +2 -0
  141. package/dist/components/transactions/getStatusEmoji.js +20 -0
  142. package/dist/components/wallet/WalletConnect.svelte +5 -4
  143. package/dist/components/wallet/WalletConnect.svelte.d.ts +0 -1
  144. package/dist/consts.d.ts +1 -0
  145. package/dist/consts.js +1 -0
  146. package/dist/errors/DeploymentStepsError.d.ts +11 -5
  147. package/dist/errors/DeploymentStepsError.js +13 -7
  148. package/dist/errors/index.d.ts +1 -1
  149. package/dist/errors/index.js +1 -1
  150. package/dist/hooks/useLocalDb.d.ts +3 -0
  151. package/dist/hooks/useLocalDb.js +10 -0
  152. package/dist/hooks/useRaindexClient.d.ts +3 -0
  153. package/dist/hooks/useRaindexClient.js +11 -0
  154. package/dist/hooks/useRaindexOrderBuilder.d.ts +3 -0
  155. package/dist/hooks/useRaindexOrderBuilder.js +11 -0
  156. package/dist/index.d.ts +122 -91
  157. package/dist/index.js +118 -87
  158. package/dist/models/Transaction.d.ts +75 -0
  159. package/dist/models/Transaction.js +100 -0
  160. package/dist/providers/LocalDbProvider.svelte +8 -0
  161. package/dist/providers/LocalDbProvider.svelte.d.ts +21 -0
  162. package/dist/providers/RaindexClientProvider.svelte +8 -0
  163. package/dist/providers/RaindexClientProvider.svelte.d.ts +21 -0
  164. package/dist/providers/RaindexOrderBuilderProvider.svelte +8 -0
  165. package/dist/providers/RaindexOrderBuilderProvider.svelte.d.ts +21 -0
  166. package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte +8 -0
  167. package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte.d.ts +24 -0
  168. package/dist/providers/dotrainRegistry/context.d.ts +9 -0
  169. package/dist/providers/dotrainRegistry/context.js +43 -0
  170. package/dist/providers/dotrainRegistry/useDotrainRegistry.d.ts +5 -0
  171. package/dist/providers/dotrainRegistry/useDotrainRegistry.js +35 -0
  172. package/dist/providers/registry/RegistryManager.d.ts +65 -0
  173. package/dist/providers/registry/RegistryManager.js +134 -0
  174. package/dist/providers/registry/RegistryProvider.svelte +6 -0
  175. package/dist/providers/registry/RegistryProvider.svelte.d.ts +21 -0
  176. package/dist/providers/registry/context.d.ts +10 -0
  177. package/dist/providers/registry/context.js +46 -0
  178. package/dist/providers/registry/useRegistry.d.ts +7 -0
  179. package/dist/providers/registry/useRegistry.js +29 -0
  180. package/dist/providers/toasts/ToastProvider.svelte +17 -0
  181. package/dist/providers/toasts/ToastProvider.svelte.d.ts +18 -0
  182. package/dist/providers/toasts/context.d.ts +14 -0
  183. package/dist/providers/toasts/context.js +22 -0
  184. package/dist/providers/toasts/useToasts.d.ts +16 -0
  185. package/dist/providers/toasts/useToasts.js +63 -0
  186. package/dist/providers/transactions/TransactionManager.d.ts +234 -0
  187. package/dist/providers/transactions/TransactionManager.js +509 -0
  188. package/dist/providers/transactions/TransactionProvider.svelte +11 -0
  189. package/dist/providers/transactions/TransactionProvider.svelte.d.ts +24 -0
  190. package/dist/providers/transactions/context.d.ts +19 -0
  191. package/dist/providers/transactions/context.js +28 -0
  192. package/dist/providers/transactions/useTransactions.d.ts +13 -0
  193. package/dist/providers/transactions/useTransactions.js +18 -0
  194. package/dist/providers/wallet/WalletProvider.svelte +7 -0
  195. package/dist/providers/wallet/WalletProvider.svelte.d.ts +21 -0
  196. package/dist/providers/wallet/context.d.ts +10 -0
  197. package/dist/providers/wallet/context.js +47 -0
  198. package/dist/providers/wallet/useAccount.d.ts +8 -0
  199. package/dist/providers/wallet/useAccount.js +148 -0
  200. package/dist/queries/keys.d.ts +1 -0
  201. package/dist/queries/keys.js +10 -9
  202. package/dist/queries/queryClient.d.ts +2 -2
  203. package/dist/queries/queryClient.js +16 -11
  204. package/dist/services/awaitTransactionIndexing.d.ts +107 -0
  205. package/dist/services/awaitTransactionIndexing.js +60 -0
  206. package/dist/services/getExplorerLink.d.ts +1 -1
  207. package/dist/services/getExplorerLink.js +3 -5
  208. package/dist/services/handleShareChoices.d.ts +2 -2
  209. package/dist/services/handleShareChoices.js +6 -5
  210. package/dist/services/historicalOrderCharts.d.ts +3 -3
  211. package/dist/services/historicalOrderCharts.js +364 -371
  212. package/dist/services/index.d.ts +5 -2
  213. package/dist/services/index.js +3 -1
  214. package/dist/services/loadRegistryUrl.d.ts +2 -0
  215. package/dist/services/loadRegistryUrl.js +22 -0
  216. package/dist/services/pairTradesChartData.d.ts +47 -0
  217. package/dist/services/pairTradesChartData.js +194 -0
  218. package/dist/services/registry.d.ts +5 -5
  219. package/dist/services/registry.js +17 -217
  220. package/dist/services/time.d.ts +12 -0
  221. package/dist/services/time.js +88 -6
  222. package/dist/services/validateAmount.d.ts +30 -0
  223. package/dist/services/validateAmount.js +53 -0
  224. package/dist/storesGeneric/cachedWritableStore.d.ts +57 -0
  225. package/dist/storesGeneric/cachedWritableStore.js +93 -0
  226. package/dist/storesGeneric/scrub.d.ts +14 -0
  227. package/dist/storesGeneric/scrub.js +22 -0
  228. package/dist/test/matchers.d.ts +2 -2
  229. package/dist/test/matchers.js +2 -2
  230. package/dist/types/account.d.ts +3 -0
  231. package/dist/types/appStores.d.ts +9 -16
  232. package/dist/types/modal.d.ts +26 -14
  233. package/dist/types/order.d.ts +10 -0
  234. package/dist/types/order.js +1 -0
  235. package/dist/types/toast.d.ts +11 -0
  236. package/dist/types/toast.js +1 -0
  237. package/dist/types/tokenBalance.d.ts +6 -0
  238. package/dist/types/tokenBalance.js +1 -0
  239. package/dist/types/transaction.d.ts +67 -22
  240. package/dist/types/transaction.js +31 -1
  241. package/dist/utils/breadcrumbs.js +2 -2
  242. package/dist/utils/codeMirrorThemes.js +80 -74
  243. package/dist/utils/configHelpers.d.ts +4 -0
  244. package/dist/utils/configHelpers.js +21 -0
  245. package/dist/utils/constructHashLink.d.ts +24 -0
  246. package/dist/utils/constructHashLink.js +117 -0
  247. package/dist/utils/getNetworkName.d.ts +1 -0
  248. package/dist/utils/getNetworkName.js +13 -0
  249. package/dist/utils/hex.js +1 -1
  250. package/dist/utils/lightweightChartsThemes.d.ts +1 -1
  251. package/dist/utils/lightweightChartsThemes.js +11 -11
  252. package/dist/utils/localDbStatus.d.ts +26 -0
  253. package/dist/utils/localDbStatus.js +22 -0
  254. package/dist/utils/number.d.ts +0 -7
  255. package/dist/utils/number.js +5 -30
  256. package/dist/utils/stripTrailingWhitespace.d.ts +16 -0
  257. package/dist/utils/stripTrailingWhitespace.js +22 -0
  258. package/dist/utils/tokens.d.ts +2 -0
  259. package/dist/utils/tokens.js +3 -0
  260. package/dist/utils/vaultBalanceChangeLabels.d.ts +4 -0
  261. package/dist/utils/vaultBalanceChangeLabels.js +18 -0
  262. package/package.json +89 -84
  263. package/dist/__fixtures__/orderDetail.d.ts +0 -99
  264. package/dist/__fixtures__/orderDetail.js +0 -204
  265. package/dist/__fixtures__/settings-12-11-24.json +0 -160
  266. package/dist/__mocks__/mockTransactionStore.d.ts +0 -22
  267. package/dist/__mocks__/mockTransactionStore.js +0 -56
  268. package/dist/__mocks__/settings.d.ts +0 -3
  269. package/dist/__mocks__/settings.js +0 -37
  270. package/dist/components/CheckboxMyItemsOnly.svelte +0 -23
  271. package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +0 -21
  272. package/dist/components/ListViewOrderbookFilters.svelte +0 -58
  273. package/dist/components/ListViewOrderbookFilters.svelte.d.ts +0 -28
  274. package/dist/components/deployment/InvalidStrategiesSection.svelte +0 -19
  275. package/dist/components/deployment/InvalidStrategiesSection.svelte.d.ts +0 -19
  276. package/dist/components/deployment/StrategyPage.svelte.d.ts +0 -19
  277. package/dist/components/deployment/ValidStrategiesSection.svelte.d.ts +0 -19
  278. package/dist/components/deployment/getDeploymentTransactionArgs.d.ts +0 -17
  279. package/dist/components/deployment/getDeploymentTransactionArgs.js +0 -28
  280. package/dist/components/detail/DepositOrWithdrawButtons.svelte +0 -44
  281. package/dist/components/detail/DepositOrWithdrawButtons.svelte.d.ts +0 -26
  282. package/dist/components/dropdown/DropdownActiveSubgraphs.svelte +0 -38
  283. package/dist/components/dropdown/DropdownActiveSubgraphs.svelte.d.ts +0 -21
  284. package/dist/components/dropdown/DropdownOrderListAccounts.svelte +0 -15
  285. package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +0 -20
  286. package/dist/components/dropdown/DropdownOrderStatus.svelte +0 -31
  287. package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +0 -19
  288. package/dist/hooks/useGui.d.ts +0 -3
  289. package/dist/hooks/useGui.js +0 -11
  290. package/dist/providers/GuiProvider.svelte +0 -8
  291. package/dist/providers/GuiProvider.svelte.d.ts +0 -21
  292. package/dist/stores/transactionStore.d.ts +0 -98
  293. package/dist/stores/transactionStore.js +0 -303
  294. package/dist/types/strategy.d.ts +0 -10
  295. package/dist/utils/time.d.ts +0 -12
  296. package/dist/utils/time.js +0 -27
  297. package/dist/utils/vault.d.ts +0 -2
  298. package/dist/utils/vault.js +0 -29
  299. /package/dist/types/{strategy.js → account.js} +0 -0
@@ -1,9 +1,9 @@
1
1
  export function generateBreadcrumbs(path) {
2
- const crumbs = path.split('/');
2
+ const crumbs = path.split("/");
3
3
  return crumbs
4
4
  .map((c, i) => ({
5
5
  label: c,
6
- href: crumbs.slice(0, i + 1).join('/')
6
+ href: crumbs.slice(0, i + 1).join("/"),
7
7
  }))
8
8
  .slice(1, -1);
9
9
  }
@@ -1,86 +1,92 @@
1
- import { createTheme } from 'thememirror';
2
- import { tags } from '@lezer/highlight';
1
+ import { createTheme } from "thememirror";
2
+ import { tags } from "@lezer/highlight";
3
3
  // configured to resemble vscode default light theme
4
4
  export const lightCodeMirrorTheme = createTheme({
5
- variant: 'light',
5
+ variant: "light",
6
6
  settings: {
7
- background: '#ffffff',
8
- foreground: '#001080',
9
- caret: '#000000',
10
- selection: '#add6ff',
11
- lineHighlight: '#77777740',
12
- gutterBackground: '#eeeeee',
13
- gutterForeground: '#237893'
7
+ background: "#ffffff",
8
+ foreground: "#001080",
9
+ caret: "#000000",
10
+ selection: "#add6ff",
11
+ lineHighlight: "#77777740",
12
+ gutterBackground: "#eeeeee",
13
+ gutterForeground: "#237893",
14
14
  },
15
15
  styles: [
16
- { tag: tags.comment, color: '#008001' },
17
- { tag: tags.variableName, color: '#0070c1' },
18
- { tag: [tags.string, tags.special(tags.brace)], color: '#b55b00' },
19
- { tag: tags.number, color: '#00b97b' },
20
- { tag: tags.bool, color: '#0000ff' },
21
- { tag: tags.null, color: '#0000ff' },
22
- { tag: tags.unit, color: '#0000ff' },
23
- { tag: tags.keyword, color: '#af01db' },
24
- { tag: tags.operator, color: '#000000' },
25
- { tag: tags.className, color: '#257f99' },
26
- { tag: tags.meta, color: '#0950a9' },
27
- { tag: tags.definition(tags.typeName), color: '#257f99' },
28
- { tag: tags.angleBracket, color: '#213CF1' },
29
- { tag: tags.brace, color: '#213CF1' },
30
- { tag: tags.bracket, color: '#213CF1' },
31
- { tag: tags.squareBracket, color: '#213CF1' },
32
- { tag: tags.paren, color: '#213CF1' },
33
- { tag: tags.punctuation, color: '#464646' },
34
- { tag: tags.separator, color: '#464646' },
35
- { tag: tags.typeName, color: '#257f99' },
36
- { tag: tags.tagName, color: '#800000' },
37
- { tag: tags.attributeName, color: '#eb3d36' },
38
- { tag: tags.attributeValue, color: '#444444' },
39
- { tag: tags.content, color: '#b55b00' },
40
- { tag: [tags.propertyName, tags.definition(tags.propertyName)], color: '#0469ff' },
41
- { tag: tags.labelName, color: '#4fc4ff' },
42
- { tag: tags.deleted, color: '#cc0000' }
43
- ]
16
+ { tag: tags.comment, color: "#008001" },
17
+ { tag: tags.variableName, color: "#0070c1" },
18
+ { tag: [tags.string, tags.special(tags.brace)], color: "#b55b00" },
19
+ { tag: tags.number, color: "#00b97b" },
20
+ { tag: tags.bool, color: "#0000ff" },
21
+ { tag: tags.null, color: "#0000ff" },
22
+ { tag: tags.unit, color: "#0000ff" },
23
+ { tag: tags.keyword, color: "#af01db" },
24
+ { tag: tags.operator, color: "#000000" },
25
+ { tag: tags.className, color: "#257f99" },
26
+ { tag: tags.meta, color: "#0950a9" },
27
+ { tag: tags.definition(tags.typeName), color: "#257f99" },
28
+ { tag: tags.angleBracket, color: "#213CF1" },
29
+ { tag: tags.brace, color: "#213CF1" },
30
+ { tag: tags.bracket, color: "#213CF1" },
31
+ { tag: tags.squareBracket, color: "#213CF1" },
32
+ { tag: tags.paren, color: "#213CF1" },
33
+ { tag: tags.punctuation, color: "#464646" },
34
+ { tag: tags.separator, color: "#464646" },
35
+ { tag: tags.typeName, color: "#257f99" },
36
+ { tag: tags.tagName, color: "#800000" },
37
+ { tag: tags.attributeName, color: "#eb3d36" },
38
+ { tag: tags.attributeValue, color: "#444444" },
39
+ { tag: tags.content, color: "#b55b00" },
40
+ {
41
+ tag: [tags.propertyName, tags.definition(tags.propertyName)],
42
+ color: "#0469ff",
43
+ },
44
+ { tag: tags.labelName, color: "#4fc4ff" },
45
+ { tag: tags.deleted, color: "#cc0000" },
46
+ ],
44
47
  });
45
48
  // configured to resemble vscode default dark theme
46
49
  export const darkCodeMirrorTheme = createTheme({
47
- variant: 'dark',
50
+ variant: "dark",
48
51
  settings: {
49
- background: '#1e1e1e',
50
- foreground: '#d4d4d4',
51
- caret: '#d4d4d4',
52
- selection: '#ffffff',
53
- lineHighlight: '#99999940',
54
- gutterBackground: '#282828',
55
- gutterForeground: '#858585'
52
+ background: "#1e1e1e",
53
+ foreground: "#d4d4d4",
54
+ caret: "#d4d4d4",
55
+ selection: "#ffffff",
56
+ lineHighlight: "#99999940",
57
+ gutterBackground: "#282828",
58
+ gutterForeground: "#858585",
56
59
  },
57
60
  styles: [
58
- { tag: [tags.comment, tags.lineComment], color: '#6c9e57' },
59
- { tag: tags.variableName, color: '#9cdcfe' },
60
- { tag: [tags.string, tags.special(tags.brace)], color: '#ce9178' },
61
- { tag: tags.number, color: '#B6CFA9' },
62
- { tag: tags.bool, color: '#4fc4ff' },
63
- { tag: tags.null, color: '#4fc4ff' },
64
- { tag: tags.unit, color: '#608FC2' },
65
- { tag: tags.keyword, color: '#d18dcc' },
66
- { tag: tags.operator, color: '#d4d4d4' },
67
- { tag: tags.className, color: '#4dcab1' },
68
- { tag: tags.meta, color: '#608FC2' },
69
- { tag: tags.definition(tags.typeName), color: '#4fcfb5' },
70
- { tag: tags.angleBracket, color: '#F9D849' },
71
- { tag: tags.brace, color: '#F9D849' },
72
- { tag: tags.bracket, color: '#F9D849' },
73
- { tag: tags.squareBracket, color: '#F9D849' },
74
- { tag: tags.paren, color: '#F9D849' },
75
- { tag: tags.punctuation, color: '#d4d4d4' },
76
- { tag: tags.separator, color: '#d4d4d4' },
77
- { tag: tags.typeName, color: '#4ecdb4' },
78
- { tag: tags.tagName, color: '#59a3df' },
79
- { tag: tags.attributeName, color: '#ffffff' },
80
- { tag: tags.attributeValue, color: '#ffffff' },
81
- { tag: tags.content, color: '#ce9178' },
82
- { tag: [tags.propertyName, tags.definition(tags.propertyName)], color: '#608FC2' },
83
- { tag: tags.labelName, color: '#4fc4ff' },
84
- { tag: tags.deleted, color: '#c86464' }
85
- ]
61
+ { tag: [tags.comment, tags.lineComment], color: "#6c9e57" },
62
+ { tag: tags.variableName, color: "#9cdcfe" },
63
+ { tag: [tags.string, tags.special(tags.brace)], color: "#ce9178" },
64
+ { tag: tags.number, color: "#B6CFA9" },
65
+ { tag: tags.bool, color: "#4fc4ff" },
66
+ { tag: tags.null, color: "#4fc4ff" },
67
+ { tag: tags.unit, color: "#608FC2" },
68
+ { tag: tags.keyword, color: "#d18dcc" },
69
+ { tag: tags.operator, color: "#d4d4d4" },
70
+ { tag: tags.className, color: "#4dcab1" },
71
+ { tag: tags.meta, color: "#608FC2" },
72
+ { tag: tags.definition(tags.typeName), color: "#4fcfb5" },
73
+ { tag: tags.angleBracket, color: "#F9D849" },
74
+ { tag: tags.brace, color: "#F9D849" },
75
+ { tag: tags.bracket, color: "#F9D849" },
76
+ { tag: tags.squareBracket, color: "#F9D849" },
77
+ { tag: tags.paren, color: "#F9D849" },
78
+ { tag: tags.punctuation, color: "#d4d4d4" },
79
+ { tag: tags.separator, color: "#d4d4d4" },
80
+ { tag: tags.typeName, color: "#4ecdb4" },
81
+ { tag: tags.tagName, color: "#59a3df" },
82
+ { tag: tags.attributeName, color: "#ffffff" },
83
+ { tag: tags.attributeValue, color: "#ffffff" },
84
+ { tag: tags.content, color: "#ce9178" },
85
+ {
86
+ tag: [tags.propertyName, tags.definition(tags.propertyName)],
87
+ color: "#608FC2",
88
+ },
89
+ { tag: tags.labelName, color: "#4fc4ff" },
90
+ { tag: tags.deleted, color: "#c86464" },
91
+ ],
86
92
  });
@@ -0,0 +1,4 @@
1
+ import type { AccountCfg } from "@rainlanguage/raindex";
2
+ export declare function getAccountsAsOptions(accounts?: Map<string, AccountCfg>): {
3
+ [k: string]: string;
4
+ };
@@ -0,0 +1,21 @@
1
+ export function getAccountsAsOptions(accounts) {
2
+ if (!accounts)
3
+ return {};
4
+ return Object.fromEntries(Array.from(accounts.entries()).map(([key, value]) => [key, value.address]));
5
+ }
6
+ if (import.meta.vitest) {
7
+ const { expect, it, describe } = import.meta.vitest;
8
+ describe("getAccountsAsOptions", () => {
9
+ it("should return the correct accounts as options", () => {
10
+ const accounts = new Map([
11
+ ["account1", { address: "0x1234567890abcdef", key: "account1" }],
12
+ ["account2", { address: "0xabcdef1234567890", key: "account2" }],
13
+ ]);
14
+ const result = getAccountsAsOptions(accounts);
15
+ expect(result).toEqual({
16
+ account1: "0x1234567890abcdef",
17
+ account2: "0xabcdef1234567890",
18
+ });
19
+ });
20
+ });
21
+ }
@@ -0,0 +1,24 @@
1
+ import type { Address, RaindexOrder, RaindexOrderAsIO, RaindexVault } from "@rainlanguage/raindex";
2
+ type OrderOrVault = RaindexOrder | RaindexOrderAsIO | RaindexVault;
3
+ /**
4
+ * Constructs a link path for an order or vault based on its type and network
5
+ * @param orderOrVault - The order or vault object
6
+ * @param type - The type of resource ('orders' or 'vaults')
7
+ * @param chainId - The chain id
8
+ * @param raindexAddress - The raindex address
9
+ * @returns The constructed link path
10
+ */
11
+ export declare function constructHashLink(orderOrVault: OrderOrVault, type: "orders" | "vaults", chainId: number, raindexAddress: Address): string;
12
+ /**
13
+ * Determines if an order or vault is active
14
+ * @param orderOrVault - The order or vault object
15
+ * @returns True if the order is active, false otherwise
16
+ */
17
+ export declare function isOrderOrVaultActive(orderOrVault: OrderOrVault): boolean;
18
+ /**
19
+ * Extracts the hash value from an order or vault
20
+ * @param orderOrVault - The order or vault object
21
+ * @returns The hash value
22
+ */
23
+ export declare function extractHash(orderOrVault: OrderOrVault): string;
24
+ export {};
@@ -0,0 +1,117 @@
1
+ import fc from "fast-check";
2
+ import { test } from "@fast-check/vitest";
3
+ function isOrder(obj) {
4
+ return obj && "orderHash" in obj;
5
+ }
6
+ /**
7
+ * Constructs a link path for an order or vault based on its type and network
8
+ * @param orderOrVault - The order or vault object
9
+ * @param type - The type of resource ('orders' or 'vaults')
10
+ * @param chainId - The chain id
11
+ * @param raindexAddress - The raindex address
12
+ * @returns The constructed link path
13
+ */
14
+ export function constructHashLink(orderOrVault, type, chainId, raindexAddress) {
15
+ if (!orderOrVault) {
16
+ return `/${type}`;
17
+ }
18
+ const slug = isOrder(orderOrVault)
19
+ ? orderOrVault.orderHash
20
+ : orderOrVault.id;
21
+ return `/${type}/${chainId}-${raindexAddress}-${slug}`;
22
+ }
23
+ /**
24
+ * Determines if an order or vault is active
25
+ * @param orderOrVault - The order or vault object
26
+ * @returns True if the order is active, false otherwise
27
+ */
28
+ export function isOrderOrVaultActive(orderOrVault) {
29
+ const _isOrder = isOrder(orderOrVault);
30
+ return _isOrder ? orderOrVault.active : false;
31
+ }
32
+ /**
33
+ * Extracts the hash value from an order or vault
34
+ * @param orderOrVault - The order or vault object
35
+ * @returns The hash value
36
+ */
37
+ export function extractHash(orderOrVault) {
38
+ const _isOrder = isOrder(orderOrVault);
39
+ return _isOrder
40
+ ? orderOrVault.orderHash
41
+ : orderOrVault?.id || "";
42
+ }
43
+ if (import.meta.vitest) {
44
+ const { expect, it, describe } = import.meta.vitest;
45
+ describe("constructHashLink", () => {
46
+ test.prop([
47
+ fc.record({
48
+ orderHash: fc.string(),
49
+ active: fc.boolean(),
50
+ }),
51
+ fc.oneof(fc.constant("orders"), fc.constant("vaults")),
52
+ fc.integer(),
53
+ fc.string(),
54
+ ])("constructs correct link for orders", (order, type, chainId, raindexAddress) => {
55
+ const result = constructHashLink(order, type, chainId, raindexAddress);
56
+ expect(result).toBe(`/${type}/${chainId}-${raindexAddress}-${order.orderHash}`);
57
+ });
58
+ test.prop([
59
+ fc.record({
60
+ id: fc.string(),
61
+ owner: fc.string(),
62
+ }),
63
+ fc.oneof(fc.constant("orders"), fc.constant("vaults")),
64
+ fc.integer(),
65
+ fc.string(),
66
+ ])("constructs correct link for vaults", (vault, type, chainId, raindexAddress) => {
67
+ const result = constructHashLink(vault, type, chainId, raindexAddress);
68
+ expect(result).toBe(`/${type}/${chainId}-${raindexAddress}-${vault.id}`);
69
+ });
70
+ });
71
+ describe("isOrderOrVaultActive", () => {
72
+ test.prop([
73
+ fc.record({
74
+ orderHash: fc.string(),
75
+ active: fc.boolean(),
76
+ }),
77
+ ])("returns correct active status for orders", (order) => {
78
+ const result = isOrderOrVaultActive(order);
79
+ expect(result).toBe(order.active);
80
+ });
81
+ test.prop([
82
+ fc.record({
83
+ id: fc.string(),
84
+ owner: fc.string(),
85
+ }),
86
+ ])("returns false for vaults", (vault) => {
87
+ const result = isOrderOrVaultActive(vault);
88
+ expect(result).toBe(false);
89
+ });
90
+ });
91
+ describe("extractHash", () => {
92
+ test.prop([
93
+ fc.record({
94
+ orderHash: fc.string(),
95
+ active: fc.boolean(),
96
+ }),
97
+ ])("extracts hash from orders", (order) => {
98
+ const result = extractHash(order);
99
+ expect(result).toBe(order.orderHash);
100
+ });
101
+ test.prop([
102
+ fc.record({
103
+ id: fc.string(),
104
+ owner: fc.string(),
105
+ }),
106
+ ])("extracts hash from vaults", (vault) => {
107
+ const result = extractHash(vault);
108
+ expect(result).toBe(vault.id);
109
+ });
110
+ it("handles undefined vault id", () => {
111
+ // Create a partial vault object with undefined id
112
+ const vault = { id: undefined };
113
+ const result = extractHash(vault);
114
+ expect(result).toBe("");
115
+ });
116
+ });
117
+ }
@@ -0,0 +1 @@
1
+ export declare function getNetworkName(chainId: number): string | undefined;
@@ -0,0 +1,13 @@
1
+ import * as chains from "viem/chains";
2
+ export function getNetworkName(chainId) {
3
+ const chain = Object.values(chains).find((chain) => chain.id === chainId);
4
+ return chain?.name;
5
+ }
6
+ if (import.meta.vitest) {
7
+ describe("getNetworkName", () => {
8
+ it("should return the network name for a given chain id", () => {
9
+ expect(getNetworkName(1)).toBe("Ethereum");
10
+ expect(getNetworkName(137)).toBe("Polygon");
11
+ });
12
+ });
13
+ }
package/dist/utils/hex.js CHANGED
@@ -1,3 +1,3 @@
1
- import { toHex } from 'viem';
1
+ import { toHex } from "viem";
2
2
  export const HEX_INPUT_REGEX = /^(0x)?([0-9a-f]+)?$/;
3
3
  export const bigintStringToHex = (val) => toHex(BigInt(val));
@@ -1,4 +1,4 @@
1
- import { ColorType } from 'lightweight-charts';
1
+ import { ColorType } from "lightweight-charts";
2
2
  export interface ChartTheme {
3
3
  layout: {
4
4
  textColor: string;
@@ -1,21 +1,21 @@
1
- import { ColorType } from 'lightweight-charts';
1
+ import { ColorType } from "lightweight-charts";
2
2
  export const darkChartTheme = {
3
3
  layout: {
4
- textColor: 'white',
5
- background: { type: ColorType.Solid, color: 'transparent' }
4
+ textColor: "white",
5
+ background: { type: ColorType.Solid, color: "transparent" },
6
6
  },
7
7
  grid: {
8
- vertLines: { color: '#484848' },
9
- horzLines: { color: '#484848' }
10
- }
8
+ vertLines: { color: "#484848" },
9
+ horzLines: { color: "#484848" },
10
+ },
11
11
  };
12
12
  export const lightChartTheme = {
13
13
  layout: {
14
- textColor: 'black',
15
- background: { type: ColorType.Solid, color: 'transparent' }
14
+ textColor: "black",
15
+ background: { type: ColorType.Solid, color: "transparent" },
16
16
  },
17
17
  grid: {
18
- vertLines: { color: '#ECECEC' },
19
- horzLines: { color: '#ECECEC' }
20
- }
18
+ vertLines: { color: "#ECECEC" },
19
+ horzLines: { color: "#ECECEC" },
20
+ },
21
21
  };
@@ -0,0 +1,26 @@
1
+ import type { LocalDbStatus } from "@rainlanguage/raindex";
2
+ /**
3
+ * The minimal shape required to aggregate a top-level localdb status: anything
4
+ * carrying a per-chain/per-raindex {@link LocalDbStatus} and an optional error
5
+ * message (e.g. `NetworkSyncStatus` or `RaindexSyncStatus`).
6
+ */
7
+ export interface AggregableSyncStatus {
8
+ status: LocalDbStatus;
9
+ error?: string;
10
+ }
11
+ /**
12
+ * Collapses many per-chain / per-raindex sync statuses into the single
13
+ * top-level localdb status shown in the sidebar badge.
14
+ *
15
+ * Priority is `failure` > `syncing` > `active`:
16
+ * - If any status is `failure`, the result is `failure` (carrying that
17
+ * status's error).
18
+ * - Else if any status is `syncing`, the result is `syncing`.
19
+ * - Else the result is `active`.
20
+ *
21
+ * An empty input (nothing configured) is treated as `active`.
22
+ */
23
+ export declare function aggregateLocalDbStatus(statuses: AggregableSyncStatus[]): {
24
+ status: LocalDbStatus;
25
+ error: string | undefined;
26
+ };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Collapses many per-chain / per-raindex sync statuses into the single
3
+ * top-level localdb status shown in the sidebar badge.
4
+ *
5
+ * Priority is `failure` > `syncing` > `active`:
6
+ * - If any status is `failure`, the result is `failure` (carrying that
7
+ * status's error).
8
+ * - Else if any status is `syncing`, the result is `syncing`.
9
+ * - Else the result is `active`.
10
+ *
11
+ * An empty input (nothing configured) is treated as `active`.
12
+ */
13
+ export function aggregateLocalDbStatus(statuses) {
14
+ const failure = statuses.find((s) => s.status === "failure");
15
+ if (failure) {
16
+ return { status: "failure", error: failure.error };
17
+ }
18
+ if (statuses.some((s) => s.status === "syncing")) {
19
+ return { status: "syncing", error: undefined };
20
+ }
21
+ return { status: "active", error: undefined };
22
+ }
@@ -5,10 +5,3 @@
5
5
  * @param decimalPoint - (optional) The number of digits to keep after "." in final result, defaults to valueDecimals
6
6
  */
7
7
  export declare function bigintStringToPercentage(value: string, valueDecimals: number, finalDecimalsDigits?: number): string;
8
- /**
9
- * Converts a bigint value to a floating point number with the specified number of decimals
10
- * @param value - The bigint value to convert
11
- * @param decimals - The number of decimal places to use in the conversion
12
- * @returns The converted floating point number
13
- */
14
- export declare function bigintToFloat(value: bigint, decimals: number): number;
@@ -1,4 +1,4 @@
1
- import { formatUnits } from 'viem';
1
+ import { formatUnits } from "viem";
2
2
  /**
3
3
  * Converts a bigint string value to a percentage with optionally given number of decimal points
4
4
  * @param value - The bigint string value
@@ -6,38 +6,13 @@ import { formatUnits } from 'viem';
6
6
  * @param decimalPoint - (optional) The number of digits to keep after "." in final result, defaults to valueDecimals
7
7
  */
8
8
  export function bigintStringToPercentage(value, valueDecimals, finalDecimalsDigits) {
9
- const finalDecimals = typeof finalDecimalsDigits !== 'undefined' ? finalDecimalsDigits : valueDecimals;
9
+ const finalDecimals = typeof finalDecimalsDigits !== "undefined"
10
+ ? finalDecimalsDigits
11
+ : valueDecimals;
10
12
  let valueString = formatUnits(BigInt(value) * 100n, valueDecimals);
11
- const index = valueString.indexOf('.');
13
+ const index = valueString.indexOf(".");
12
14
  if (index > -1) {
13
15
  valueString = valueString.substring(0, finalDecimals === 0 ? index : index + finalDecimals + 1);
14
16
  }
15
17
  return valueString;
16
18
  }
17
- /**
18
- * Converts a bigint value to a floating point number with the specified number of decimals
19
- * @param value - The bigint value to convert
20
- * @param decimals - The number of decimal places to use in the conversion
21
- * @returns The converted floating point number
22
- */
23
- export function bigintToFloat(value, decimals) {
24
- return parseFloat(formatUnits(value, decimals));
25
- }
26
- if (import.meta.vitest) {
27
- const { it, expect } = import.meta.vitest;
28
- it('should get percentage string from bigint string', () => {
29
- const value = '123456000000000000';
30
- const decimals = 18;
31
- const finalDecimalsDigits = 4;
32
- const result = bigintStringToPercentage(value, decimals, finalDecimalsDigits);
33
- const expected = '12.3456';
34
- expect(result).toEqual(expected);
35
- });
36
- it('should convert bigint to float', () => {
37
- const value = 123456000000000000n;
38
- const decimals = 18;
39
- const result = bigintToFloat(value, decimals);
40
- const expected = 0.123456;
41
- expect(result).toEqual(expected);
42
- });
43
- }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Removes trailing whitespace from rainlang/dotrain editor text, mirroring the
3
+ * "delete trailing whitespace on save" behaviour of common code editors.
4
+ *
5
+ * - Trailing spaces and tabs are removed from the end of every line.
6
+ * - Line breaks between content are preserved (`\r\n` is normalised to `\n`).
7
+ * - Internal blank lines are preserved (only their trailing whitespace is
8
+ * stripped) so deliberate spacing in the source is kept.
9
+ * - Trailing blank lines and a trailing newline at the very end of the text are
10
+ * removed, so the saved text never ends in dangling whitespace.
11
+ * - Leading whitespace (indentation) is never touched.
12
+ *
13
+ * @param text - The editor contents to normalise.
14
+ * @returns The text with trailing whitespace stripped.
15
+ */
16
+ export declare function stripTrailingWhitespace(text: string): string;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Removes trailing whitespace from rainlang/dotrain editor text, mirroring the
3
+ * "delete trailing whitespace on save" behaviour of common code editors.
4
+ *
5
+ * - Trailing spaces and tabs are removed from the end of every line.
6
+ * - Line breaks between content are preserved (`\r\n` is normalised to `\n`).
7
+ * - Internal blank lines are preserved (only their trailing whitespace is
8
+ * stripped) so deliberate spacing in the source is kept.
9
+ * - Trailing blank lines and a trailing newline at the very end of the text are
10
+ * removed, so the saved text never ends in dangling whitespace.
11
+ * - Leading whitespace (indentation) is never touched.
12
+ *
13
+ * @param text - The editor contents to normalise.
14
+ * @returns The text with trailing whitespace stripped.
15
+ */
16
+ export function stripTrailingWhitespace(text) {
17
+ return text
18
+ .split(/\r\n|\r|\n/)
19
+ .map((line) => line.replace(/[ \t]+$/, ""))
20
+ .join("\n")
21
+ .replace(/\n+$/, "");
22
+ }
@@ -0,0 +1,2 @@
1
+ import type { RaindexVaultToken } from "@rainlanguage/raindex";
2
+ export declare function getTokenDisplayName(token: RaindexVaultToken): string;
@@ -0,0 +1,3 @@
1
+ export function getTokenDisplayName(token) {
2
+ return token.symbol || token.name || "Unknown Token";
3
+ }
@@ -0,0 +1,4 @@
1
+ import type { RaindexVaultBalanceChangeType, VaultBalanceChangeFilter } from "@rainlanguage/raindex";
2
+ export declare const VAULT_BALANCE_CHANGE_LABELS: Record<RaindexVaultBalanceChangeType, string>;
3
+ export declare const VAULT_BALANCE_CHANGE_FILTER_LABELS: Record<VaultBalanceChangeFilter, string>;
4
+ export declare function labelForVaultBalanceChangeType(type: RaindexVaultBalanceChangeType): string;
@@ -0,0 +1,18 @@
1
+ export const VAULT_BALANCE_CHANGE_LABELS = {
2
+ deposit: "Deposit",
3
+ withdrawal: "Withdrawal",
4
+ takeOrder: "Take order",
5
+ clear: "Clear",
6
+ clearBounty: "Clear Bounty",
7
+ unknown: "Unknown",
8
+ };
9
+ export const VAULT_BALANCE_CHANGE_FILTER_LABELS = {
10
+ deposit: "Deposit",
11
+ withdrawal: "Withdrawal",
12
+ takeOrder: "Take order",
13
+ clear: "Clear",
14
+ clearBounty: "Clear Bounty",
15
+ };
16
+ export function labelForVaultBalanceChangeType(type) {
17
+ return VAULT_BALANCE_CHANGE_LABELS[type] ?? type;
18
+ }