@rainlanguage/ui-components 0.0.1-alpha.13 → 0.0.1-alpha.131

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 (188) hide show
  1. package/dist/__fixtures__/orderDetail.d.ts +1 -1
  2. package/dist/__fixtures__/settings.yaml +183 -0
  3. package/dist/__mocks__/MockComponent.svelte +4 -0
  4. package/dist/__mocks__/MockComponent.svelte.d.ts +3 -1
  5. package/dist/__mocks__/settings.d.ts +7 -3
  6. package/dist/__mocks__/settings.js +68 -33
  7. package/dist/__mocks__/stores.d.ts +94 -27
  8. package/dist/__mocks__/stores.js +45 -22
  9. package/dist/components/ButtonLoading.svelte +1 -1
  10. package/dist/components/ButtonVaultLink.svelte +3 -3
  11. package/dist/components/ButtonVaultLink.svelte.d.ts +1 -1
  12. package/dist/components/CheckboxMyItemsOnly.svelte +3 -2
  13. package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +2 -3
  14. package/dist/components/CheckboxZeroBalanceVault.svelte.d.ts +2 -2
  15. package/dist/components/CodeMirrorDotrain.svelte +4 -0
  16. package/dist/components/CodeMirrorDotrain.svelte.d.ts +1 -0
  17. package/dist/components/CodeMirrorRainlang.svelte +11 -3
  18. package/dist/components/CodeMirrorRainlang.svelte.d.ts +1 -1
  19. package/dist/components/EditableSpan.svelte +3 -14
  20. package/dist/components/EditableSpan.svelte.d.ts +0 -1
  21. package/dist/components/Hash.svelte +3 -3
  22. package/dist/components/License.svelte +5 -4
  23. package/dist/components/ListViewOrderbookFilters.svelte +16 -15
  24. package/dist/components/ListViewOrderbookFilters.svelte.d.ts +9 -13
  25. package/dist/components/OrderOrVaultHash.svelte +10 -7
  26. package/dist/components/OrderOrVaultHash.svelte.d.ts +1 -1
  27. package/dist/components/PageHeader.svelte +1 -1
  28. package/dist/components/TanstackAppTable.svelte +2 -3
  29. package/dist/components/TanstackAppTable.svelte.d.ts +1 -1
  30. package/dist/components/ToastDetail.svelte +42 -0
  31. package/dist/components/ToastDetail.svelte.d.ts +20 -0
  32. package/dist/components/Tooltip.svelte +8 -0
  33. package/dist/components/Tooltip.svelte.d.ts +21 -0
  34. package/dist/components/charts/OrderTradesChart.svelte +3 -2
  35. package/dist/components/charts/TanstackLightweightChartLine.svelte +5 -9
  36. package/dist/components/charts/VaultBalanceChart.svelte +6 -6
  37. package/dist/components/charts/VaultBalanceChart.svelte.d.ts +1 -1
  38. package/dist/components/charts/transformAndSortData.d.ts +24 -0
  39. package/dist/components/charts/transformAndSortData.js +111 -0
  40. package/dist/components/checkbox/CheckboxActiveOrders.svelte +11 -0
  41. package/dist/components/checkbox/CheckboxActiveOrders.svelte.d.ts +19 -0
  42. package/dist/components/deployment/ButtonSelectOption.svelte +2 -0
  43. package/dist/components/deployment/ButtonSelectOption.svelte.d.ts +1 -0
  44. package/dist/components/deployment/ComposedRainlangModal.svelte +7 -5
  45. package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +1 -4
  46. package/dist/components/deployment/DeploymentSectionHeader.svelte +7 -4
  47. package/dist/components/deployment/DeploymentSteps.svelte +169 -185
  48. package/dist/components/deployment/DeploymentSteps.svelte.d.ts +7 -13
  49. package/dist/components/deployment/DeploymentsSection.svelte +18 -14
  50. package/dist/components/deployment/DepositInput.svelte +32 -14
  51. package/dist/components/deployment/DepositInput.svelte.d.ts +1 -2
  52. package/dist/components/deployment/DisclaimerModal.svelte +1 -0
  53. package/dist/components/deployment/FieldDefinitionInput.svelte +22 -14
  54. package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +1 -2
  55. package/dist/components/deployment/SelectToken.svelte +16 -4
  56. package/dist/components/deployment/SelectToken.svelte.d.ts +1 -2
  57. package/dist/components/deployment/StrategyPage.svelte +6 -2
  58. package/dist/components/deployment/TokenIOInput.svelte +16 -5
  59. package/dist/components/deployment/TokenIOInput.svelte.d.ts +1 -2
  60. package/dist/components/detail/OrderDetail.svelte +60 -44
  61. package/dist/components/detail/OrderDetail.svelte.d.ts +11 -8
  62. package/dist/components/detail/TanstackOrderQuote.svelte +17 -7
  63. package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +1 -1
  64. package/dist/components/detail/VaultDetail.svelte +43 -43
  65. package/dist/components/detail/VaultDetail.svelte.d.ts +11 -11
  66. package/dist/components/dropdown/DropdownActiveSubgraphs.svelte +2 -2
  67. package/dist/components/dropdown/DropdownActiveSubgraphs.svelte.d.ts +4 -4
  68. package/dist/components/dropdown/DropdownOrderListAccounts.svelte +2 -1
  69. package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +3 -3
  70. package/dist/components/icon/Refresh.svelte +2 -1
  71. package/dist/components/icon/Refresh.svelte.d.ts +1 -0
  72. package/dist/components/input/InputOrderHash.svelte +1 -1
  73. package/dist/components/input/InputOrderHash.svelte.d.ts +2 -2
  74. package/dist/components/input/InputRegistryUrl.svelte +36 -14
  75. package/dist/components/input/InputToken.svelte +2 -2
  76. package/dist/components/input/InputTokenAmount.svelte +1 -1
  77. package/dist/components/tables/OrderAPY.svelte +4 -9
  78. package/dist/components/tables/OrderTradesListTable.svelte +7 -3
  79. package/dist/components/tables/OrderVaultsVolTable.svelte +11 -2
  80. package/dist/components/tables/OrdersListTable.svelte +27 -31
  81. package/dist/components/tables/OrdersListTable.svelte.d.ts +2 -8
  82. package/dist/components/tables/VaultBalanceChangesTable.svelte +8 -6
  83. package/dist/components/tables/VaultsListTable.svelte +53 -67
  84. package/dist/components/tables/VaultsListTable.svelte.d.ts +12 -20
  85. package/dist/components/transactions/FixedBottomTransaction.svelte +63 -0
  86. package/dist/components/transactions/FixedBottomTransaction.svelte.d.ts +16 -0
  87. package/dist/components/transactions/TransactionDetail.svelte +31 -0
  88. package/dist/components/transactions/TransactionDetail.svelte.d.ts +20 -0
  89. package/dist/components/transactions/TransactionList.svelte +17 -0
  90. package/dist/components/transactions/TransactionList.svelte.d.ts +16 -0
  91. package/dist/components/transactions/getStatusEmoji.d.ts +2 -0
  92. package/dist/components/transactions/getStatusEmoji.js +20 -0
  93. package/dist/components/wallet/WalletConnect.svelte +5 -4
  94. package/dist/components/wallet/WalletConnect.svelte.d.ts +0 -1
  95. package/dist/consts.d.ts +1 -0
  96. package/dist/consts.js +1 -0
  97. package/dist/errors/DeploymentStepsError.d.ts +6 -2
  98. package/dist/errors/DeploymentStepsError.js +5 -1
  99. package/dist/hooks/useGui.d.ts +3 -0
  100. package/dist/hooks/useGui.js +11 -0
  101. package/dist/index.d.ts +27 -11
  102. package/dist/index.js +28 -8
  103. package/dist/models/Transaction.d.ts +80 -0
  104. package/dist/models/Transaction.js +134 -0
  105. package/dist/providers/GuiProvider.svelte +8 -0
  106. package/dist/providers/GuiProvider.svelte.d.ts +21 -0
  107. package/dist/providers/registry/RegistryManager.d.ts +65 -0
  108. package/dist/providers/registry/RegistryManager.js +133 -0
  109. package/dist/providers/registry/RegistryProvider.svelte +6 -0
  110. package/dist/providers/registry/RegistryProvider.svelte.d.ts +21 -0
  111. package/dist/providers/registry/context.d.ts +10 -0
  112. package/dist/providers/registry/context.js +46 -0
  113. package/dist/providers/registry/useRegistry.d.ts +7 -0
  114. package/dist/providers/registry/useRegistry.js +29 -0
  115. package/dist/providers/toasts/ToastProvider.svelte +17 -0
  116. package/dist/providers/toasts/ToastProvider.svelte.d.ts +18 -0
  117. package/dist/providers/toasts/context.d.ts +14 -0
  118. package/dist/providers/toasts/context.js +22 -0
  119. package/dist/providers/toasts/useToasts.d.ts +16 -0
  120. package/dist/providers/toasts/useToasts.js +63 -0
  121. package/dist/providers/transactions/TransactionManager.d.ts +183 -0
  122. package/dist/providers/transactions/TransactionManager.js +353 -0
  123. package/dist/providers/transactions/TransactionProvider.svelte +11 -0
  124. package/dist/providers/transactions/TransactionProvider.svelte.d.ts +24 -0
  125. package/dist/providers/transactions/context.d.ts +19 -0
  126. package/dist/providers/transactions/context.js +28 -0
  127. package/dist/providers/transactions/useTransactions.d.ts +13 -0
  128. package/dist/providers/transactions/useTransactions.js +18 -0
  129. package/dist/providers/wallet/WalletProvider.svelte +7 -0
  130. package/dist/providers/wallet/WalletProvider.svelte.d.ts +21 -0
  131. package/dist/providers/wallet/context.d.ts +10 -0
  132. package/dist/providers/wallet/context.js +47 -0
  133. package/dist/providers/wallet/useAccount.d.ts +8 -0
  134. package/dist/providers/wallet/useAccount.js +148 -0
  135. package/dist/queries/queryClient.d.ts +1 -1
  136. package/dist/queries/queryClient.js +11 -6
  137. package/dist/services/awaitTransactionIndexing.d.ts +100 -0
  138. package/dist/services/awaitTransactionIndexing.js +57 -0
  139. package/dist/services/handleShareChoices.d.ts +2 -2
  140. package/dist/services/handleShareChoices.js +7 -2
  141. package/dist/services/historicalOrderCharts.d.ts +1 -1
  142. package/dist/services/historicalOrderCharts.js +1 -1
  143. package/dist/services/index.d.ts +2 -1
  144. package/dist/services/index.js +2 -1
  145. package/dist/services/loadRegistryUrl.d.ts +2 -0
  146. package/dist/services/loadRegistryUrl.js +19 -0
  147. package/dist/services/registry.d.ts +6 -0
  148. package/dist/services/registry.js +33 -77
  149. package/dist/services/time.d.ts +12 -0
  150. package/dist/services/time.js +88 -6
  151. package/dist/storesGeneric/cachedWritableStore.d.ts +57 -0
  152. package/dist/storesGeneric/cachedWritableStore.js +93 -0
  153. package/dist/types/account.d.ts +3 -0
  154. package/dist/types/account.js +1 -0
  155. package/dist/types/appStores.d.ts +10 -9
  156. package/dist/types/modal.d.ts +24 -12
  157. package/dist/types/strategy.d.ts +1 -1
  158. package/dist/types/toast.d.ts +11 -0
  159. package/dist/types/toast.js +1 -0
  160. package/dist/types/transaction.d.ts +54 -15
  161. package/dist/types/transaction.js +29 -1
  162. package/dist/utils/configHelpers.d.ts +8 -0
  163. package/dist/utils/configHelpers.js +38 -0
  164. package/dist/utils/constructHashLink.d.ts +23 -0
  165. package/dist/utils/constructHashLink.js +110 -0
  166. package/dist/utils/vault.d.ts +1 -1
  167. package/package.json +34 -34
  168. package/dist/__fixtures__/settings-12-11-24.json +0 -160
  169. package/dist/__mocks__/mockTransactionStore.d.ts +0 -22
  170. package/dist/__mocks__/mockTransactionStore.js +0 -56
  171. package/dist/components/deployment/DepositsSection.svelte +0 -8
  172. package/dist/components/deployment/DepositsSection.svelte.d.ts +0 -20
  173. package/dist/components/deployment/FieldDefinitionsSection.svelte +0 -9
  174. package/dist/components/deployment/FieldDefinitionsSection.svelte.d.ts +0 -20
  175. package/dist/components/deployment/SelectTokensSection.svelte +0 -17
  176. package/dist/components/deployment/SelectTokensSection.svelte.d.ts +0 -21
  177. package/dist/components/deployment/TokenIOSection.svelte +0 -17
  178. package/dist/components/deployment/TokenIOSection.svelte.d.ts +0 -21
  179. package/dist/components/deployment/getDeploymentTransactionArgs.d.ts +0 -17
  180. package/dist/components/deployment/getDeploymentTransactionArgs.js +0 -24
  181. package/dist/components/detail/DepositOrWithdrawButtons.svelte +0 -44
  182. package/dist/components/detail/DepositOrWithdrawButtons.svelte.d.ts +0 -26
  183. package/dist/components/dropdown/DropdownOrderStatus.svelte +0 -31
  184. package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +0 -19
  185. package/dist/stores/transactionStore.d.ts +0 -98
  186. package/dist/stores/transactionStore.js +0 -303
  187. package/dist/utils/time.d.ts +0 -12
  188. package/dist/utils/time.js +0 -27
@@ -1,2 +1,2 @@
1
- import type { SgVault } from '@rainlanguage/orderbook/js_api';
1
+ import type { SgVault } from '@rainlanguage/orderbook';
2
2
  export declare const vaultBalanceDisplay: (vault: SgVault) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rainlanguage/ui-components",
3
- "version": "0.0.1-alpha.13",
3
+ "version": "0.0.1-alpha.131",
4
4
  "description": "A component library for building Svelte applications to be used with Raindex.",
5
5
  "license": "LicenseRef-DCL-1.0",
6
6
  "author": "Rain Open Source Software Ltd",
@@ -49,38 +49,38 @@
49
49
  "types": "./dist/index.d.ts",
50
50
  "type": "module",
51
51
  "dependencies": {
52
- "@codemirror/lang-yaml": "^6.0.0",
53
- "@fontsource/dm-sans": "^5.0.18",
54
- "@imask/svelte": "^7.3.0",
55
- "@observablehq/plot": "^0.6.13",
56
- "@rainlanguage/orderbook": "0.0.1-alpha.13",
57
- "@reown/appkit": "^1.6.4",
58
- "@reown/appkit-adapter-wagmi": "^1.6.4",
59
- "@sentry/sveltekit": "^7.107.0",
60
- "@square/svelte-store": "^1.0.18",
61
- "@sveltejs/kit": "^2.0.0",
62
- "@tanstack/svelte-query": "^5.59.20",
63
- "@wagmi/core": "^2.16.3",
64
- "@walletconnect/ethereum-provider": "^2.11.3",
65
- "@walletconnect/modal": "^2.6.2",
66
- "@web3modal/ethers5": "^4.1.1",
67
- "camelcase-keys": "^9.1.3",
68
- "codemirror-rainlang": "^3.0.13",
69
- "dayjs": "^1.11.13",
70
- "ethers": "^5.7.2",
71
- "flowbite": "^2.2.1",
72
- "flowbite-svelte": "^0.44.21",
73
- "flowbite-svelte-icons": "^0.4.5",
74
- "fuse.js": "^7.0.0",
75
- "lightweight-charts": "^4.1.3",
76
- "lodash": "^4.17.21",
77
- "svelte": "^4.2.7",
78
- "svelte-codemirror-editor": "^1.3.0",
79
- "svelte-markdown": "^0.4.1",
80
- "tailwind-merge": "^2.5.4",
81
- "thememirror": "^2.0.1",
82
- "uuid": "^9.0.1",
83
- "viem": "^2.22.8",
84
- "wagmi": "^2.14.7"
52
+ "@codemirror/lang-yaml": "6.1.1",
53
+ "@fontsource/dm-sans": "5.1.0",
54
+ "@imask/svelte": "7.6.1",
55
+ "@observablehq/plot": "0.6.16",
56
+ "@rainlanguage/orderbook": "0.0.1-alpha.131",
57
+ "@reown/appkit": "1.6.4",
58
+ "@reown/appkit-adapter-wagmi": "1.6.4",
59
+ "@sentry/sveltekit": "7.120.0",
60
+ "@square/svelte-store": "1.0.18",
61
+ "@sveltejs/kit": "2.8.1",
62
+ "@tanstack/svelte-query": "5.59.20",
63
+ "@wagmi/core": "2.16.3",
64
+ "@walletconnect/ethereum-provider": "2.17.2",
65
+ "@walletconnect/modal": "2.7.0",
66
+ "@web3modal/ethers5": "4.2.3",
67
+ "camelcase-keys": "9.1.3",
68
+ "codemirror-rainlang": "3.0.13",
69
+ "dayjs": "1.11.13",
70
+ "ethers": "5.7.2",
71
+ "flowbite": "2.5.2",
72
+ "flowbite-svelte": "0.44.24",
73
+ "flowbite-svelte-icons": "0.4.5",
74
+ "fuse.js": "7.0.0",
75
+ "lightweight-charts": "4.2.1",
76
+ "lodash": "4.17.21",
77
+ "svelte": "4.2.19",
78
+ "svelte-codemirror-editor": "1.4.1",
79
+ "svelte-markdown": "0.4.1",
80
+ "tailwind-merge": "2.5.4",
81
+ "thememirror": "2.0.1",
82
+ "uuid": "9.0.1",
83
+ "viem": "2.24.3",
84
+ "wagmi": "2.14.7"
85
85
  }
86
86
  }
@@ -1,160 +0,0 @@
1
- {
2
- "accounts": {
3
- "wallet1": "0xf08bCbce72f62c95Dcb7c07dCb5Ed26ACfCfBc11",
4
- "wallet2": "0x6bc14a99ccf7f9037c98d75eec6c6d807f9d953f"
5
- },
6
- "networks": {
7
- "flare": {
8
- "rpc": "https://rpc.ankr.com/flare",
9
- "chain-id": 14,
10
- "currency": "FLR"
11
- },
12
- "base": {
13
- "rpc": "https://mainnet.base.org",
14
- "chain-id": 8453,
15
- "network-id": 8453,
16
- "currency": "ETH"
17
- },
18
- "sepolia": {
19
- "rpc": "https://1rpc.io/sepolia",
20
- "chain-id": 11155111,
21
- "network-id": 11155111,
22
- "currency": "ETH"
23
- },
24
- "polygon": {
25
- "rpc": "https://rpc.ankr.com/polygon",
26
- "chain-id": 137,
27
- "network-id": 137,
28
- "currency": "POL"
29
- },
30
- "arbitrum": {
31
- "rpc": "https://rpc.ankr.com/arbitrum",
32
- "chain-id": 42161,
33
- "network-id": 42161,
34
- "currency": "ETH"
35
- },
36
- "bsc": {
37
- "rpc": "https://rpc.ankr.com/bsc",
38
- "chain-id": 56,
39
- "network-id": 56,
40
- "currency": "BNB"
41
- },
42
- "linea": {
43
- "rpc": "https://rpc.linea.build",
44
- "chain-id": 59144,
45
- "network-id": 59144,
46
- "currency": "ETH"
47
- },
48
- "ethereum": {
49
- "rpc": "https://rpc.ankr.com/eth",
50
- "chain-id": 1,
51
- "network-id": 1,
52
- "currency": "ETH"
53
- }
54
- },
55
- "subgraphs": {
56
- "flare": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-flare/0.8/gn",
57
- "base": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-base/0.9/gn",
58
- "sepolia": "http://replaceme.com",
59
- "polygon": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-polygon/0.6/gn",
60
- "arbitrum": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-arbitrum/0.2/gn",
61
- "bsc": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-bsc/2024-10-14-63f4/gn",
62
- "linea": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-linea/2024-10-14-12fc/gn",
63
- "ethereum": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-mainnet/2024-10-25-af6a/gn"
64
- },
65
- "metaboards": {
66
- "flare": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-flare-0x893BBFB7/0.1/gn",
67
- "base": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-base-0x59401C93/0.1/gn",
68
- "sepolia": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-sepolia-0x77991674/0.1/gn",
69
- "polygon": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-polygon/0.1/gn",
70
- "arbitrum": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-arbitrum/0.1/gn",
71
- "bsc": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-bsc/0.1/gn",
72
- "linea": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-linea-0xed7d6156/1.0.0/gn",
73
- "ethereum": "https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/metadata-mainnet/2024-10-25-2857/gn"
74
- },
75
- "orderbooks": {
76
- "flare": {
77
- "address": "0xCEe8Cd002F151A536394E564b84076c41bBBcD4d",
78
- "network": "flare",
79
- "subgraph": "flare"
80
- },
81
- "base": {
82
- "address": "0xd2938e7c9fe3597f78832ce780feb61945c377d7",
83
- "network": "base",
84
- "subgraph": "base"
85
- },
86
- "sepolia": {
87
- "address": "0x0bB72B4C7c0d47b2CaED07c804D9243C1B8a0728",
88
- "network": "sepolia",
89
- "subgraph": "sepolia"
90
- },
91
- "polygon": {
92
- "address": "0x7D2f700b1f6FD75734824EA4578960747bdF269A",
93
- "network": "polygon",
94
- "subgraph": "polygon"
95
- },
96
- "arbitrum": {
97
- "address": "0x550878091b2B1506069F61ae59e3A5484Bca9166",
98
- "network": "arbitrum",
99
- "subgraph": "arbitrum"
100
- },
101
- "matchain": {
102
- "address": "0x40312edab8fe65091354172ad79e9459f21094e2",
103
- "network": "matchain",
104
- "subgraph": "matchain"
105
- },
106
- "bsc": {
107
- "address": "0xd2938E7c9fe3597F78832CE780Feb61945c377d7",
108
- "network": "bsc",
109
- "subgraph": "bsc"
110
- },
111
- "linea": {
112
- "address": "0x22410e2a46261a1B1e3899a072f303022801C764",
113
- "network": "linea",
114
- "subgraph": "linea"
115
- },
116
- "ethereum": {
117
- "address": "0x0eA6d458488d1cf51695e1D6e4744e6FB715d37C",
118
- "network": "ethereum",
119
- "subgraph": "ethereum"
120
- }
121
- },
122
- "deployers": {
123
- "flare": {
124
- "address": "0xE3989Ea7486c0F418C764e6c511e86f6E8830FAb",
125
- "network": "flare"
126
- },
127
- "base": {
128
- "address": "0xC1A14cE2fd58A3A2f99deCb8eDd866204eE07f8D",
129
- "network": "base"
130
- },
131
- "sepolia": {
132
- "address": "0x7692BA8446Bb8B3140A2c02df073080BeD0a7F8E",
133
- "network": "sepolia"
134
- },
135
- "polygon": {
136
- "address": "0xE7116BC05C8afe25e5B54b813A74F916B5D42aB1",
137
- "network": "polygon"
138
- },
139
- "arbitrum": {
140
- "address": "0x9B0D254bd858208074De3d2DaF5af11b3D2F377F",
141
- "network": "arbitrum"
142
- },
143
- "matchain": {
144
- "address": "0x582d9e838FE6cD9F8147C66A8f56A3FBE513a6A2",
145
- "network": "polygon"
146
- },
147
- "bsc": {
148
- "address": "0xA2f56F8F74B7d04d61f281BE6576b6155581dcBA",
149
- "network": "bsc"
150
- },
151
- "linea": {
152
- "address": "0xA2f56F8F74B7d04d61f281BE6576b6155581dcBA",
153
- "network": "linea"
154
- },
155
- "ethereum": {
156
- "address": "0xd19581a021f4704ad4eBfF68258e7A0a9DB1CD77",
157
- "network": "ethereum"
158
- }
159
- }
160
- }
@@ -1,22 +0,0 @@
1
- import { TransactionStatus, TransactionErrorMessage } from '../stores/transactionStore';
2
- type MockTransactionStoreState = {
3
- status: TransactionStatus;
4
- error: string;
5
- hash: string;
6
- data: null;
7
- functionName: string;
8
- message: string;
9
- };
10
- export declare const mockTransactionStore: {
11
- subscribe: (this: void, run: import("svelte/store").Subscriber<MockTransactionStoreState>, invalidate?: import("svelte/store").Invalidator<MockTransactionStoreState> | undefined) => import("svelte/store").Unsubscriber;
12
- set: (this: void, value: MockTransactionStoreState) => void;
13
- reset: () => void;
14
- handleDeploymentTransaction: () => Promise<void>;
15
- checkingWalletAllowance: (message?: string) => void;
16
- awaitWalletConfirmation: (message?: string) => void;
17
- awaitApprovalTx: (hash: string) => void;
18
- transactionSuccess: (hash: string, message?: string) => void;
19
- transactionError: (error: TransactionErrorMessage, hash?: string) => void;
20
- mockSetSubscribeValue: (value: Partial<MockTransactionStoreState>) => void;
21
- };
22
- export {};
@@ -1,56 +0,0 @@
1
- import { writable } from 'svelte/store';
2
- import { TransactionStatus, TransactionErrorMessage } from '../stores/transactionStore';
3
- const initialState = {
4
- status: TransactionStatus.IDLE,
5
- error: '',
6
- hash: '',
7
- data: null,
8
- functionName: '',
9
- message: ''
10
- };
11
- const mockTransactionWritable = writable(initialState);
12
- export const mockTransactionStore = {
13
- subscribe: mockTransactionWritable.subscribe,
14
- set: mockTransactionWritable.set,
15
- reset: () => mockTransactionWritable.set(initialState),
16
- handleDeploymentTransaction: async () => {
17
- mockTransactionWritable.update((state) => ({
18
- ...state,
19
- status: TransactionStatus.SUCCESS,
20
- message: 'Strategy deployed successfully!',
21
- hash: '0x123'
22
- }));
23
- },
24
- checkingWalletAllowance: (message = '') => mockTransactionWritable.update((state) => ({
25
- ...state,
26
- status: TransactionStatus.CHECKING_ALLOWANCE,
27
- message
28
- })),
29
- awaitWalletConfirmation: (message = '') => mockTransactionWritable.update((state) => ({
30
- ...state,
31
- status: TransactionStatus.PENDING_WALLET,
32
- message
33
- })),
34
- awaitApprovalTx: (hash) => mockTransactionWritable.update((state) => ({
35
- ...state,
36
- hash,
37
- status: TransactionStatus.PENDING_APPROVAL,
38
- message: ''
39
- })),
40
- transactionSuccess: (hash, message = '') => mockTransactionWritable.update((state) => ({
41
- ...state,
42
- status: TransactionStatus.SUCCESS,
43
- hash,
44
- message
45
- })),
46
- transactionError: (error, hash = '') => mockTransactionWritable.update((state) => ({
47
- ...state,
48
- status: TransactionStatus.ERROR,
49
- error,
50
- hash
51
- })),
52
- mockSetSubscribeValue: (value) => mockTransactionWritable.update((state) => ({
53
- ...state,
54
- ...value
55
- }))
56
- };
@@ -1,8 +0,0 @@
1
- <script>import DepositInput from "./DepositInput.svelte";
2
- export let allDepositFields;
3
- export let gui;
4
- </script>
5
-
6
- {#each allDepositFields as deposit}
7
- <DepositInput bind:deposit {gui} />
8
- {/each}
@@ -1,20 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { DotrainOrderGui, GuiDepositCfg } from '@rainlanguage/orderbook/js_api';
3
- declare const __propDef: {
4
- props: {
5
- allDepositFields: GuiDepositCfg[];
6
- gui: DotrainOrderGui;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- exports?: {} | undefined;
13
- bindings?: string | undefined;
14
- };
15
- export type DepositsSectionProps = typeof __propDef.props;
16
- export type DepositsSectionEvents = typeof __propDef.events;
17
- export type DepositsSectionSlots = typeof __propDef.slots;
18
- export default class DepositsSection extends SvelteComponent<DepositsSectionProps, DepositsSectionEvents, DepositsSectionSlots> {
19
- }
20
- export {};
@@ -1,9 +0,0 @@
1
- <script>import FieldDefinitionInput from "./FieldDefinitionInput.svelte";
2
- import {} from "@rainlanguage/orderbook/js_api";
3
- export let allFieldDefinitions;
4
- export let gui;
5
- </script>
6
-
7
- {#each allFieldDefinitions as fieldDefinition}
8
- <FieldDefinitionInput {fieldDefinition} {gui} />
9
- {/each}
@@ -1,20 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import { type DotrainOrderGui, type GuiFieldDefinitionCfg } from '@rainlanguage/orderbook/js_api';
3
- declare const __propDef: {
4
- props: {
5
- allFieldDefinitions: GuiFieldDefinitionCfg[];
6
- gui: DotrainOrderGui;
7
- };
8
- events: {
9
- [evt: string]: CustomEvent<any>;
10
- };
11
- slots: {};
12
- exports?: {} | undefined;
13
- bindings?: string | undefined;
14
- };
15
- export type FieldDefinitionsSectionProps = typeof __propDef.props;
16
- export type FieldDefinitionsSectionEvents = typeof __propDef.events;
17
- export type FieldDefinitionsSectionSlots = typeof __propDef.slots;
18
- export default class FieldDefinitionsSection extends SvelteComponent<FieldDefinitionsSectionProps, FieldDefinitionsSectionEvents, FieldDefinitionsSectionSlots> {
19
- }
20
- export {};
@@ -1,17 +0,0 @@
1
- <script>import DeploymentSectionHeader from "./DeploymentSectionHeader.svelte";
2
- import SelectToken from "./SelectToken.svelte";
3
- import { DotrainOrderGui } from "@rainlanguage/orderbook/js_api";
4
- export let gui;
5
- export let selectTokens;
6
- export let onSelectTokenSelect;
7
- </script>
8
-
9
- <div class="flex w-full flex-col gap-4">
10
- <DeploymentSectionHeader
11
- title="Select Tokens"
12
- description="Select the tokens that you want to use in your order."
13
- />
14
- {#each selectTokens as token}
15
- <SelectToken {token} bind:gui {onSelectTokenSelect} />
16
- {/each}
17
- </div>
@@ -1,21 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import { DotrainOrderGui, type SelectTokens } from '@rainlanguage/orderbook/js_api';
3
- declare const __propDef: {
4
- props: {
5
- gui: DotrainOrderGui;
6
- selectTokens: SelectTokens;
7
- onSelectTokenSelect: () => void;
8
- };
9
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {};
13
- exports?: {} | undefined;
14
- bindings?: string | undefined;
15
- };
16
- export type SelectTokensSectionProps = typeof __propDef.props;
17
- export type SelectTokensSectionEvents = typeof __propDef.events;
18
- export type SelectTokensSectionSlots = typeof __propDef.slots;
19
- export default class SelectTokensSection extends SvelteComponent<SelectTokensSectionProps, SelectTokensSectionEvents, SelectTokensSectionSlots> {
20
- }
21
- export {};
@@ -1,17 +0,0 @@
1
- <script>import TokenIOInput from "./TokenIOInput.svelte";
2
- export let allTokenInputs = [];
3
- export let allTokenOutputs = [];
4
- export let gui;
5
- </script>
6
-
7
- {#if allTokenInputs.length > 0}
8
- {#each allTokenInputs as input, i}
9
- <TokenIOInput {i} label="Input" vault={input} {gui} />
10
- {/each}
11
- {/if}
12
-
13
- {#if allTokenOutputs.length > 0}
14
- {#each allTokenOutputs as output, i}
15
- <TokenIOInput {i} label="Output" vault={output} {gui} />
16
- {/each}
17
- {/if}
@@ -1,21 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { DotrainOrderGui, OrderIOCfg } from '@rainlanguage/orderbook/js_api';
3
- declare const __propDef: {
4
- props: {
5
- allTokenInputs?: OrderIOCfg[];
6
- allTokenOutputs?: OrderIOCfg[];
7
- gui: DotrainOrderGui;
8
- };
9
- events: {
10
- [evt: string]: CustomEvent<any>;
11
- };
12
- slots: {};
13
- exports?: {} | undefined;
14
- bindings?: string | undefined;
15
- };
16
- export type TokenIoSectionProps = typeof __propDef.props;
17
- export type TokenIoSectionEvents = typeof __propDef.events;
18
- export type TokenIoSectionSlots = typeof __propDef.slots;
19
- export default class TokenIoSection extends SvelteComponent<TokenIoSectionProps, TokenIoSectionEvents, TokenIoSectionSlots> {
20
- }
21
- export {};
@@ -1,17 +0,0 @@
1
- import type { Config } from '@wagmi/core';
2
- import type { DepositAndAddOrderCalldataResult, DotrainOrderGui } from '@rainlanguage/orderbook/js_api';
3
- import type { Hex } from 'viem';
4
- import type { ExtendedApprovalCalldata } from '../../stores/transactionStore';
5
- export declare enum AddOrderErrors {
6
- ADD_ORDER_FAILED = "Failed to add order",
7
- MISSING_GUI = "Order GUI is required",
8
- MISSING_CONFIG = "Wagmi config is required",
9
- NO_WALLET = "No wallet address found"
10
- }
11
- export interface HandleAddOrderResult {
12
- approvals: ExtendedApprovalCalldata[];
13
- deploymentCalldata: DepositAndAddOrderCalldataResult;
14
- orderbookAddress: Hex;
15
- chainId: number;
16
- }
17
- export declare function getDeploymentTransactionArgs(gui: DotrainOrderGui, wagmiConfig: Config | undefined): Promise<HandleAddOrderResult>;
@@ -1,24 +0,0 @@
1
- import { getAccount } from '@wagmi/core';
2
- export var AddOrderErrors;
3
- (function (AddOrderErrors) {
4
- AddOrderErrors["ADD_ORDER_FAILED"] = "Failed to add order";
5
- AddOrderErrors["MISSING_GUI"] = "Order GUI is required";
6
- AddOrderErrors["MISSING_CONFIG"] = "Wagmi config is required";
7
- AddOrderErrors["NO_WALLET"] = "No wallet address found";
8
- })(AddOrderErrors || (AddOrderErrors = {}));
9
- export async function getDeploymentTransactionArgs(gui, wagmiConfig) {
10
- if (!wagmiConfig) {
11
- throw new Error(AddOrderErrors.MISSING_CONFIG);
12
- }
13
- const { address } = getAccount(wagmiConfig);
14
- if (!address) {
15
- throw new Error(AddOrderErrors.NO_WALLET);
16
- }
17
- const { approvals, deploymentCalldata, orderbookAddress, chainId } = await gui.getDeploymentTransactionArgs(address);
18
- return {
19
- approvals,
20
- deploymentCalldata,
21
- orderbookAddress: orderbookAddress,
22
- chainId
23
- };
24
- }
@@ -1,44 +0,0 @@
1
- <script>import { Button } from "flowbite-svelte";
2
- import { ArrowDownOutline, ArrowUpOutline } from "flowbite-svelte-icons";
3
- export let handleDepositOrWithdrawModal;
4
- export let vault;
5
- export let chainId;
6
- export let rpcUrl;
7
- export let query;
8
- export let subgraphUrl;
9
- </script>
10
-
11
- <Button
12
- data-testid="depositOrWithdrawButton"
13
- color="light"
14
- size="xs"
15
- on:click={() =>
16
- handleDepositOrWithdrawModal({
17
- open: true,
18
- args: {
19
- vault,
20
- onDepositOrWithdraw: $query.refetch,
21
- action: 'deposit',
22
- chainId,
23
- rpcUrl,
24
- subgraphUrl
25
- }
26
- })}><ArrowUpOutline size="xs" /></Button
27
- >
28
- <Button
29
- data-testid="depositOrWithdrawButton"
30
- color="light"
31
- size="xs"
32
- on:click={() =>
33
- handleDepositOrWithdrawModal({
34
- open: true,
35
- args: {
36
- vault,
37
- onDepositOrWithdraw: $query.refetch,
38
- action: 'withdraw',
39
- chainId,
40
- rpcUrl,
41
- subgraphUrl
42
- }
43
- })}><ArrowDownOutline size="xs" /></Button
44
- >
@@ -1,26 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { SgVault } from '@rainlanguage/orderbook/js_api';
3
- import type { CreateQueryResult } from '@tanstack/svelte-query';
4
- import type { DepositOrWithdrawModalProps } from '../../types/modal';
5
- declare const __propDef: {
6
- props: {
7
- handleDepositOrWithdrawModal: (props: DepositOrWithdrawModalProps) => void;
8
- vault: SgVault;
9
- chainId: number;
10
- rpcUrl: string;
11
- query: CreateQueryResult;
12
- subgraphUrl: string;
13
- };
14
- events: {
15
- [evt: string]: CustomEvent<any>;
16
- };
17
- slots: {};
18
- exports?: {} | undefined;
19
- bindings?: string | undefined;
20
- };
21
- export type DepositOrWithdrawButtonsProps = typeof __propDef.props;
22
- export type DepositOrWithdrawButtonsEvents = typeof __propDef.events;
23
- export type DepositOrWithdrawButtonsSlots = typeof __propDef.slots;
24
- export default class DepositOrWithdrawButtons extends SvelteComponent<DepositOrWithdrawButtonsProps, DepositOrWithdrawButtonsEvents, DepositOrWithdrawButtonsSlots> {
25
- }
26
- export {};
@@ -1,31 +0,0 @@
1
- <script>import DropdownCheckbox from "./DropdownCheckbox.svelte";
2
- export let activeOrderStatus;
3
- const orderStatusOptions = {
4
- Active: "active",
5
- Inactive: "inactive"
6
- };
7
- function handleStatusChange(event) {
8
- let status = void 0;
9
- let items = Object.keys(event.detail);
10
- if (items.length === 0 || items.length === 2) {
11
- status = void 0;
12
- } else if (items.includes("Active")) {
13
- status = true;
14
- } else if (items.includes("Inactive")) {
15
- status = false;
16
- }
17
- activeOrderStatus.set(status);
18
- }
19
- $: value = $activeOrderStatus === void 0 ? {} : $activeOrderStatus ? { Active: "active" } : { Inactive: "inactive" };
20
- </script>
21
-
22
- <div data-testid="order-status-dropdown">
23
- <DropdownCheckbox
24
- options={orderStatusOptions}
25
- on:change={handleStatusChange}
26
- label="Status"
27
- showAllLabel={false}
28
- onlyTitle={true}
29
- {value}
30
- />
31
- </div>
@@ -1,19 +0,0 @@
1
- import { SvelteComponent } from "svelte";
2
- import type { Writable } from 'svelte/store';
3
- declare const __propDef: {
4
- props: {
5
- activeOrderStatus: Writable<boolean | undefined>;
6
- };
7
- events: {
8
- [evt: string]: CustomEvent<any>;
9
- };
10
- slots: {};
11
- exports?: {} | undefined;
12
- bindings?: string | undefined;
13
- };
14
- export type DropdownOrderStatusProps = typeof __propDef.props;
15
- export type DropdownOrderStatusEvents = typeof __propDef.events;
16
- export type DropdownOrderStatusSlots = typeof __propDef.slots;
17
- export default class DropdownOrderStatus extends SvelteComponent<DropdownOrderStatusProps, DropdownOrderStatusEvents, DropdownOrderStatusSlots> {
18
- }
19
- export {};