@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.
- package/dist/__fixtures__/orderDetail.d.ts +1 -1
- package/dist/__fixtures__/settings.yaml +183 -0
- package/dist/__mocks__/MockComponent.svelte +4 -0
- package/dist/__mocks__/MockComponent.svelte.d.ts +3 -1
- package/dist/__mocks__/settings.d.ts +7 -3
- package/dist/__mocks__/settings.js +68 -33
- package/dist/__mocks__/stores.d.ts +94 -27
- package/dist/__mocks__/stores.js +45 -22
- package/dist/components/ButtonLoading.svelte +1 -1
- package/dist/components/ButtonVaultLink.svelte +3 -3
- package/dist/components/ButtonVaultLink.svelte.d.ts +1 -1
- package/dist/components/CheckboxMyItemsOnly.svelte +3 -2
- package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +2 -3
- package/dist/components/CheckboxZeroBalanceVault.svelte.d.ts +2 -2
- package/dist/components/CodeMirrorDotrain.svelte +4 -0
- package/dist/components/CodeMirrorDotrain.svelte.d.ts +1 -0
- package/dist/components/CodeMirrorRainlang.svelte +11 -3
- package/dist/components/CodeMirrorRainlang.svelte.d.ts +1 -1
- package/dist/components/EditableSpan.svelte +3 -14
- package/dist/components/EditableSpan.svelte.d.ts +0 -1
- package/dist/components/Hash.svelte +3 -3
- package/dist/components/License.svelte +5 -4
- package/dist/components/ListViewOrderbookFilters.svelte +16 -15
- package/dist/components/ListViewOrderbookFilters.svelte.d.ts +9 -13
- package/dist/components/OrderOrVaultHash.svelte +10 -7
- package/dist/components/OrderOrVaultHash.svelte.d.ts +1 -1
- package/dist/components/PageHeader.svelte +1 -1
- package/dist/components/TanstackAppTable.svelte +2 -3
- package/dist/components/TanstackAppTable.svelte.d.ts +1 -1
- package/dist/components/ToastDetail.svelte +42 -0
- package/dist/components/ToastDetail.svelte.d.ts +20 -0
- package/dist/components/Tooltip.svelte +8 -0
- package/dist/components/Tooltip.svelte.d.ts +21 -0
- package/dist/components/charts/OrderTradesChart.svelte +3 -2
- package/dist/components/charts/TanstackLightweightChartLine.svelte +5 -9
- package/dist/components/charts/VaultBalanceChart.svelte +6 -6
- package/dist/components/charts/VaultBalanceChart.svelte.d.ts +1 -1
- package/dist/components/charts/transformAndSortData.d.ts +24 -0
- package/dist/components/charts/transformAndSortData.js +111 -0
- package/dist/components/checkbox/CheckboxActiveOrders.svelte +11 -0
- package/dist/components/checkbox/CheckboxActiveOrders.svelte.d.ts +19 -0
- package/dist/components/deployment/ButtonSelectOption.svelte +2 -0
- package/dist/components/deployment/ButtonSelectOption.svelte.d.ts +1 -0
- package/dist/components/deployment/ComposedRainlangModal.svelte +7 -5
- package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +1 -4
- package/dist/components/deployment/DeploymentSectionHeader.svelte +7 -4
- package/dist/components/deployment/DeploymentSteps.svelte +169 -185
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +7 -13
- package/dist/components/deployment/DeploymentsSection.svelte +18 -14
- package/dist/components/deployment/DepositInput.svelte +32 -14
- package/dist/components/deployment/DepositInput.svelte.d.ts +1 -2
- package/dist/components/deployment/DisclaimerModal.svelte +1 -0
- package/dist/components/deployment/FieldDefinitionInput.svelte +22 -14
- package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +1 -2
- package/dist/components/deployment/SelectToken.svelte +16 -4
- package/dist/components/deployment/SelectToken.svelte.d.ts +1 -2
- package/dist/components/deployment/StrategyPage.svelte +6 -2
- package/dist/components/deployment/TokenIOInput.svelte +16 -5
- package/dist/components/deployment/TokenIOInput.svelte.d.ts +1 -2
- package/dist/components/detail/OrderDetail.svelte +60 -44
- package/dist/components/detail/OrderDetail.svelte.d.ts +11 -8
- package/dist/components/detail/TanstackOrderQuote.svelte +17 -7
- package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +1 -1
- package/dist/components/detail/VaultDetail.svelte +43 -43
- package/dist/components/detail/VaultDetail.svelte.d.ts +11 -11
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte +2 -2
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte.d.ts +4 -4
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte +2 -1
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +3 -3
- package/dist/components/icon/Refresh.svelte +2 -1
- package/dist/components/icon/Refresh.svelte.d.ts +1 -0
- package/dist/components/input/InputOrderHash.svelte +1 -1
- package/dist/components/input/InputOrderHash.svelte.d.ts +2 -2
- package/dist/components/input/InputRegistryUrl.svelte +36 -14
- package/dist/components/input/InputToken.svelte +2 -2
- package/dist/components/input/InputTokenAmount.svelte +1 -1
- package/dist/components/tables/OrderAPY.svelte +4 -9
- package/dist/components/tables/OrderTradesListTable.svelte +7 -3
- package/dist/components/tables/OrderVaultsVolTable.svelte +11 -2
- package/dist/components/tables/OrdersListTable.svelte +27 -31
- package/dist/components/tables/OrdersListTable.svelte.d.ts +2 -8
- package/dist/components/tables/VaultBalanceChangesTable.svelte +8 -6
- package/dist/components/tables/VaultsListTable.svelte +53 -67
- package/dist/components/tables/VaultsListTable.svelte.d.ts +12 -20
- package/dist/components/transactions/FixedBottomTransaction.svelte +63 -0
- package/dist/components/transactions/FixedBottomTransaction.svelte.d.ts +16 -0
- package/dist/components/transactions/TransactionDetail.svelte +31 -0
- package/dist/components/transactions/TransactionDetail.svelte.d.ts +20 -0
- package/dist/components/transactions/TransactionList.svelte +17 -0
- package/dist/components/transactions/TransactionList.svelte.d.ts +16 -0
- package/dist/components/transactions/getStatusEmoji.d.ts +2 -0
- package/dist/components/transactions/getStatusEmoji.js +20 -0
- package/dist/components/wallet/WalletConnect.svelte +5 -4
- package/dist/components/wallet/WalletConnect.svelte.d.ts +0 -1
- package/dist/consts.d.ts +1 -0
- package/dist/consts.js +1 -0
- package/dist/errors/DeploymentStepsError.d.ts +6 -2
- package/dist/errors/DeploymentStepsError.js +5 -1
- package/dist/hooks/useGui.d.ts +3 -0
- package/dist/hooks/useGui.js +11 -0
- package/dist/index.d.ts +27 -11
- package/dist/index.js +28 -8
- package/dist/models/Transaction.d.ts +80 -0
- package/dist/models/Transaction.js +134 -0
- package/dist/providers/GuiProvider.svelte +8 -0
- package/dist/providers/GuiProvider.svelte.d.ts +21 -0
- package/dist/providers/registry/RegistryManager.d.ts +65 -0
- package/dist/providers/registry/RegistryManager.js +133 -0
- package/dist/providers/registry/RegistryProvider.svelte +6 -0
- package/dist/providers/registry/RegistryProvider.svelte.d.ts +21 -0
- package/dist/providers/registry/context.d.ts +10 -0
- package/dist/providers/registry/context.js +46 -0
- package/dist/providers/registry/useRegistry.d.ts +7 -0
- package/dist/providers/registry/useRegistry.js +29 -0
- package/dist/providers/toasts/ToastProvider.svelte +17 -0
- package/dist/providers/toasts/ToastProvider.svelte.d.ts +18 -0
- package/dist/providers/toasts/context.d.ts +14 -0
- package/dist/providers/toasts/context.js +22 -0
- package/dist/providers/toasts/useToasts.d.ts +16 -0
- package/dist/providers/toasts/useToasts.js +63 -0
- package/dist/providers/transactions/TransactionManager.d.ts +183 -0
- package/dist/providers/transactions/TransactionManager.js +353 -0
- package/dist/providers/transactions/TransactionProvider.svelte +11 -0
- package/dist/providers/transactions/TransactionProvider.svelte.d.ts +24 -0
- package/dist/providers/transactions/context.d.ts +19 -0
- package/dist/providers/transactions/context.js +28 -0
- package/dist/providers/transactions/useTransactions.d.ts +13 -0
- package/dist/providers/transactions/useTransactions.js +18 -0
- package/dist/providers/wallet/WalletProvider.svelte +7 -0
- package/dist/providers/wallet/WalletProvider.svelte.d.ts +21 -0
- package/dist/providers/wallet/context.d.ts +10 -0
- package/dist/providers/wallet/context.js +47 -0
- package/dist/providers/wallet/useAccount.d.ts +8 -0
- package/dist/providers/wallet/useAccount.js +148 -0
- package/dist/queries/queryClient.d.ts +1 -1
- package/dist/queries/queryClient.js +11 -6
- package/dist/services/awaitTransactionIndexing.d.ts +100 -0
- package/dist/services/awaitTransactionIndexing.js +57 -0
- package/dist/services/handleShareChoices.d.ts +2 -2
- package/dist/services/handleShareChoices.js +7 -2
- package/dist/services/historicalOrderCharts.d.ts +1 -1
- package/dist/services/historicalOrderCharts.js +1 -1
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.js +2 -1
- package/dist/services/loadRegistryUrl.d.ts +2 -0
- package/dist/services/loadRegistryUrl.js +19 -0
- package/dist/services/registry.d.ts +6 -0
- package/dist/services/registry.js +33 -77
- package/dist/services/time.d.ts +12 -0
- package/dist/services/time.js +88 -6
- package/dist/storesGeneric/cachedWritableStore.d.ts +57 -0
- package/dist/storesGeneric/cachedWritableStore.js +93 -0
- package/dist/types/account.d.ts +3 -0
- package/dist/types/account.js +1 -0
- package/dist/types/appStores.d.ts +10 -9
- package/dist/types/modal.d.ts +24 -12
- package/dist/types/strategy.d.ts +1 -1
- package/dist/types/toast.d.ts +11 -0
- package/dist/types/toast.js +1 -0
- package/dist/types/transaction.d.ts +54 -15
- package/dist/types/transaction.js +29 -1
- package/dist/utils/configHelpers.d.ts +8 -0
- package/dist/utils/configHelpers.js +38 -0
- package/dist/utils/constructHashLink.d.ts +23 -0
- package/dist/utils/constructHashLink.js +110 -0
- package/dist/utils/vault.d.ts +1 -1
- package/package.json +34 -34
- package/dist/__fixtures__/settings-12-11-24.json +0 -160
- package/dist/__mocks__/mockTransactionStore.d.ts +0 -22
- package/dist/__mocks__/mockTransactionStore.js +0 -56
- package/dist/components/deployment/DepositsSection.svelte +0 -8
- package/dist/components/deployment/DepositsSection.svelte.d.ts +0 -20
- package/dist/components/deployment/FieldDefinitionsSection.svelte +0 -9
- package/dist/components/deployment/FieldDefinitionsSection.svelte.d.ts +0 -20
- package/dist/components/deployment/SelectTokensSection.svelte +0 -17
- package/dist/components/deployment/SelectTokensSection.svelte.d.ts +0 -21
- package/dist/components/deployment/TokenIOSection.svelte +0 -17
- package/dist/components/deployment/TokenIOSection.svelte.d.ts +0 -21
- package/dist/components/deployment/getDeploymentTransactionArgs.d.ts +0 -17
- package/dist/components/deployment/getDeploymentTransactionArgs.js +0 -24
- package/dist/components/detail/DepositOrWithdrawButtons.svelte +0 -44
- package/dist/components/detail/DepositOrWithdrawButtons.svelte.d.ts +0 -26
- package/dist/components/dropdown/DropdownOrderStatus.svelte +0 -31
- package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +0 -19
- package/dist/stores/transactionStore.d.ts +0 -98
- package/dist/stores/transactionStore.js +0 -303
- package/dist/utils/time.d.ts +0 -12
- package/dist/utils/time.js +0 -27
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
networks:
|
|
3
|
+
flare:
|
|
4
|
+
key: flare
|
|
5
|
+
rpc: https://rpc.ankr.com/flare
|
|
6
|
+
chainId: 14
|
|
7
|
+
currency: FLR
|
|
8
|
+
base:
|
|
9
|
+
key: base
|
|
10
|
+
rpc: https://mainnet.base.org
|
|
11
|
+
chainId: 8453
|
|
12
|
+
currency: ETH
|
|
13
|
+
sepolia:
|
|
14
|
+
key: sepolia
|
|
15
|
+
rpc: https://1rpc.io/sepolia
|
|
16
|
+
chainId: 11155111
|
|
17
|
+
currency: ETH
|
|
18
|
+
polygon:
|
|
19
|
+
key: polygon
|
|
20
|
+
rpc: https://rpc.ankr.com/polygon
|
|
21
|
+
chainId: 137
|
|
22
|
+
currency: POL
|
|
23
|
+
arbitrum:
|
|
24
|
+
key: arbitrum
|
|
25
|
+
rpc: https://rpc.ankr.com/arbitrum
|
|
26
|
+
chainId: 42161
|
|
27
|
+
currency: ETH
|
|
28
|
+
matchain:
|
|
29
|
+
key: matchain
|
|
30
|
+
rpc: https://rpc.ankr.com/polygon
|
|
31
|
+
chainId: 137
|
|
32
|
+
currency: POL
|
|
33
|
+
bsc:
|
|
34
|
+
key: bsc
|
|
35
|
+
rpc: https://rpc.ankr.com/bsc
|
|
36
|
+
chainId: 56
|
|
37
|
+
currency: BNB
|
|
38
|
+
linea:
|
|
39
|
+
key: linea
|
|
40
|
+
rpc: https://rpc.linea.build
|
|
41
|
+
chainId: 59144
|
|
42
|
+
currency: ETH
|
|
43
|
+
ethereum:
|
|
44
|
+
key: ethereum
|
|
45
|
+
rpc: https://rpc.ankr.com/eth
|
|
46
|
+
chainId: 1
|
|
47
|
+
currency: ETH
|
|
48
|
+
subgraphs:
|
|
49
|
+
flare:
|
|
50
|
+
key: flare
|
|
51
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-flare/0.8/gn
|
|
52
|
+
base:
|
|
53
|
+
key: base
|
|
54
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-base/0.9/gn
|
|
55
|
+
sepolia:
|
|
56
|
+
key: sepolia
|
|
57
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-sepolia/0.1/gn
|
|
58
|
+
arbitrum:
|
|
59
|
+
key: arbitrum
|
|
60
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-arbitrum/0.2/gn
|
|
61
|
+
bsc:
|
|
62
|
+
key: bsc
|
|
63
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-bsc/2024-10-14-63f4/gn
|
|
64
|
+
linea:
|
|
65
|
+
key: linea
|
|
66
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-linea/2024-10-14-12fc/gn
|
|
67
|
+
ethereum:
|
|
68
|
+
key: ethereum
|
|
69
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/ob4-mainnet/2024-10-25-af6a/gn
|
|
70
|
+
metaboards:
|
|
71
|
+
flare:
|
|
72
|
+
key: flare
|
|
73
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-flare-0x893BBFB7/0.1/gn
|
|
74
|
+
base:
|
|
75
|
+
key: base
|
|
76
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-base-0x59401C93/0.1/gn
|
|
77
|
+
sepolia:
|
|
78
|
+
key: sepolia
|
|
79
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-sepolia-0x77991674/0.1/gn
|
|
80
|
+
polygon:
|
|
81
|
+
key: polygon
|
|
82
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-polygon/0.1/gn
|
|
83
|
+
arbitrum:
|
|
84
|
+
key: arbitrum
|
|
85
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-arbitrum/0.1/gn
|
|
86
|
+
bsc:
|
|
87
|
+
key: bsc
|
|
88
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-bsc/0.1/gn
|
|
89
|
+
linea:
|
|
90
|
+
key: linea
|
|
91
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/mb-linea-0xed7d6156/1.0.0/gn
|
|
92
|
+
ethereum:
|
|
93
|
+
key: ethereum
|
|
94
|
+
url: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/metadata-mainnet/2024-10-25-2857/gn
|
|
95
|
+
orderbooks:
|
|
96
|
+
flare:
|
|
97
|
+
key: flare
|
|
98
|
+
address: 0xCEe8Cd002F151A536394E564b84076c41bBBcD4d
|
|
99
|
+
network: flare
|
|
100
|
+
subgraph: flare
|
|
101
|
+
base:
|
|
102
|
+
key: base
|
|
103
|
+
address: 0xd2938e7c9fe3597f78832ce780feb61945c377d7
|
|
104
|
+
network: base
|
|
105
|
+
subgraph: base
|
|
106
|
+
sepolia:
|
|
107
|
+
key: sepolia
|
|
108
|
+
address: 0x0bB72B4C7c0d47b2CaED07c804D9243C1B8a0728
|
|
109
|
+
network: sepolia
|
|
110
|
+
subgraph: sepolia
|
|
111
|
+
polygon:
|
|
112
|
+
key: polygon
|
|
113
|
+
address: 0x7D2f700b1f6FD75734824EA4578960747bdF269A
|
|
114
|
+
network: polygon
|
|
115
|
+
subgraph: polygon
|
|
116
|
+
arbitrum:
|
|
117
|
+
key: arbitrum
|
|
118
|
+
address: 0x550878091b2B1506069F61ae59e3A5484Bca9166
|
|
119
|
+
network: arbitrum
|
|
120
|
+
subgraph: arbitrum
|
|
121
|
+
matchain:
|
|
122
|
+
key: matchain
|
|
123
|
+
address: 0x40312edab8fe65091354172ad79e9459f21094e2
|
|
124
|
+
network: matchain
|
|
125
|
+
subgraph: matchain
|
|
126
|
+
bsc:
|
|
127
|
+
key: bsc
|
|
128
|
+
address: 0xd2938E7c9fe3597F78832CE780Feb61945c377d7
|
|
129
|
+
network: bsc
|
|
130
|
+
subgraph: bsc
|
|
131
|
+
linea:
|
|
132
|
+
key: linea
|
|
133
|
+
address: 0x22410e2a46261a1B1e3899a072f303022801C764
|
|
134
|
+
network: linea
|
|
135
|
+
subgraph: linea
|
|
136
|
+
ethereum:
|
|
137
|
+
key: ethereum
|
|
138
|
+
address: 0x0eA6d458488d1cf51695e1D6e4744e6FB715d37C
|
|
139
|
+
network: ethereum
|
|
140
|
+
subgraph: ethereum
|
|
141
|
+
deployers:
|
|
142
|
+
flare:
|
|
143
|
+
key: flare
|
|
144
|
+
address: 0xE3989Ea7486c0F418C764e6c511e86f6E8830FAb
|
|
145
|
+
network: flare
|
|
146
|
+
base:
|
|
147
|
+
key: base
|
|
148
|
+
address: 0xC1A14cE2fd58A3A2f99deCb8eDd866204eE07f8D
|
|
149
|
+
network: base
|
|
150
|
+
sepolia:
|
|
151
|
+
key: sepolia
|
|
152
|
+
address: 0x7692BA8446Bb8B3140A2c02df073080BeD0a7F8E
|
|
153
|
+
network: sepolia
|
|
154
|
+
polygon:
|
|
155
|
+
key: polygon
|
|
156
|
+
address: 0xE7116BC05C8afe25e5B54b813A74F916B5D42aB1
|
|
157
|
+
network: polygon
|
|
158
|
+
arbitrum:
|
|
159
|
+
key: arbitrum
|
|
160
|
+
address: 0x9B0D254bd858208074De3d2DaF5af11b3D2F377F
|
|
161
|
+
network: arbitrum
|
|
162
|
+
matchain:
|
|
163
|
+
key: matchain
|
|
164
|
+
address: 0x582d9e838FE6cD9F8147C66A8f56A3FBE513a6A2
|
|
165
|
+
network: matchain
|
|
166
|
+
bsc:
|
|
167
|
+
key: bsc
|
|
168
|
+
address: 0xA2f56F8F74B7d04d61f281BE6576b6155581dcBA
|
|
169
|
+
network: bsc
|
|
170
|
+
linea:
|
|
171
|
+
key: linea
|
|
172
|
+
address: 0xA2f56F8F74B7d04d61f281BE6576b6155581dcBA
|
|
173
|
+
network: linea
|
|
174
|
+
ethereum:
|
|
175
|
+
key: ethereum
|
|
176
|
+
address: 0xd19581a021f4704ad4eBfF68258e7A0a9DB1CD77
|
|
177
|
+
accounts:
|
|
178
|
+
wallet1:
|
|
179
|
+
key: wallet1
|
|
180
|
+
address: 0xf08bCbce72f62c95Dcb7c07dCb5Ed26ACfCfBc11
|
|
181
|
+
wallet2:
|
|
182
|
+
key: wallet2
|
|
183
|
+
address: 0x6bc14a99ccf7f9037c98d75eec6c6d807f9d953f
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const mockSettingsStore:
|
|
1
|
+
import type { NewConfig } from '@rainlanguage/orderbook';
|
|
2
|
+
export declare const mockConfig: NewConfig;
|
|
3
|
+
export declare const mockSettingsStore: {
|
|
4
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<NewConfig>, invalidate?: import("svelte/store").Invalidator<NewConfig> | undefined) => import("svelte/store").Unsubscriber;
|
|
5
|
+
set: (this: void, value: NewConfig) => void;
|
|
6
|
+
mockSetSubscribeValue: (value: NewConfig) => void;
|
|
7
|
+
};
|
|
@@ -1,37 +1,72 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
|
-
export const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
export const mockConfig = {
|
|
3
|
+
orderbook: {
|
|
4
|
+
networks: {
|
|
5
|
+
mainnet: {
|
|
6
|
+
key: 'mainnet',
|
|
7
|
+
rpc: 'https://mainnet.infura.io/v3/YOUR-PROJECT-ID',
|
|
8
|
+
chainId: 1,
|
|
9
|
+
label: 'Ethereum Mainnet',
|
|
10
|
+
currency: 'ETH'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
subgraphs: {
|
|
14
|
+
mainnet: {
|
|
15
|
+
key: 'mainnet',
|
|
16
|
+
url: 'https://api.thegraph.com/subgraphs/name/mainnet'
|
|
17
|
+
},
|
|
18
|
+
flare: {
|
|
19
|
+
key: 'flare',
|
|
20
|
+
url: 'https://api.thegraph.com/subgraphs/name/flare'
|
|
21
|
+
},
|
|
22
|
+
testnet: {
|
|
23
|
+
key: 'testnet',
|
|
24
|
+
url: 'https://api.thegraph.com/subgraphs/name/testnet'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
orderbooks: {
|
|
28
|
+
orderbook1: {
|
|
29
|
+
key: 'orderbook1',
|
|
30
|
+
address: '0xOrderbookAddress1',
|
|
31
|
+
network: {
|
|
32
|
+
key: 'mainnet',
|
|
33
|
+
rpc: 'https://mainnet.infura.io/v3/YOUR-PROJECT-ID',
|
|
34
|
+
chainId: 1,
|
|
35
|
+
label: 'Ethereum Mainnet',
|
|
36
|
+
currency: 'ETH'
|
|
37
|
+
},
|
|
38
|
+
subgraph: {
|
|
39
|
+
key: 'uniswap',
|
|
40
|
+
url: 'https://api.thegraph.com/subgraphs/name/uniswap'
|
|
41
|
+
},
|
|
42
|
+
label: 'Orderbook 1'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
deployers: {
|
|
46
|
+
deployer1: {
|
|
47
|
+
key: 'deployer1',
|
|
48
|
+
address: '0xDeployerAddress1',
|
|
49
|
+
network: {
|
|
50
|
+
key: 'mainnet',
|
|
51
|
+
rpc: 'https://mainnet.infura.io/v3/YOUR-PROJECT-ID',
|
|
52
|
+
chainId: 1,
|
|
53
|
+
label: 'Ethereum Mainnet',
|
|
54
|
+
currency: 'ETH'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
metaboards: {
|
|
59
|
+
metaboard1: 'https://example.com/metaboard1'
|
|
60
|
+
},
|
|
61
|
+
accounts: {
|
|
62
|
+
name_one: 'address_one',
|
|
63
|
+
name_two: 'address_two'
|
|
9
64
|
}
|
|
10
|
-
},
|
|
11
|
-
subgraphs: {
|
|
12
|
-
mainnet: 'https://api.thegraph.com/subgraphs/name/mainnet'
|
|
13
|
-
},
|
|
14
|
-
orderbooks: {
|
|
15
|
-
orderbook1: {
|
|
16
|
-
address: '0xOrderbookAddress1',
|
|
17
|
-
network: 'mainnet',
|
|
18
|
-
subgraph: 'uniswap',
|
|
19
|
-
label: 'Orderbook 1'
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
deployers: {
|
|
23
|
-
deployer1: {
|
|
24
|
-
address: '0xDeployerAddress1',
|
|
25
|
-
network: 'mainnet',
|
|
26
|
-
label: 'Deployer 1'
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
metaboards: {
|
|
30
|
-
metaboard1: 'https://example.com/metaboard1'
|
|
31
|
-
},
|
|
32
|
-
accounts: {
|
|
33
|
-
name_one: 'address_one',
|
|
34
|
-
name_two: 'address_two'
|
|
35
65
|
}
|
|
36
66
|
};
|
|
37
|
-
|
|
67
|
+
const mockSettingsStoreWritable = writable(mockConfig);
|
|
68
|
+
export const mockSettingsStore = {
|
|
69
|
+
subscribe: mockSettingsStoreWritable.subscribe,
|
|
70
|
+
set: mockSettingsStoreWritable.set,
|
|
71
|
+
mockSetSubscribeValue: (value) => mockSettingsStoreWritable.set(value)
|
|
72
|
+
};
|
|
@@ -1,33 +1,47 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AccountCfg, NewConfig, SubgraphCfg } from '@rainlanguage/orderbook';
|
|
2
2
|
import { type Config } from '@wagmi/core';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
declare const initialPageState: {
|
|
4
|
+
data: {
|
|
5
|
+
stores: {
|
|
6
|
+
settings: {};
|
|
7
|
+
};
|
|
8
|
+
dotrain: string;
|
|
9
|
+
deployment: {
|
|
10
|
+
key: string;
|
|
11
|
+
};
|
|
12
|
+
strategyDetail: {};
|
|
13
|
+
};
|
|
14
|
+
url: URL;
|
|
15
|
+
params: {};
|
|
16
|
+
form: {};
|
|
17
|
+
status: number;
|
|
18
|
+
error: null;
|
|
19
|
+
route: {
|
|
20
|
+
id: null;
|
|
21
|
+
};
|
|
8
22
|
};
|
|
9
23
|
export declare const mockSettingsStore: {
|
|
10
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<
|
|
11
|
-
set: (this: void, value:
|
|
12
|
-
mockSetSubscribeValue: (value:
|
|
24
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<NewConfig>, invalidate?: import("svelte/store").Invalidator<NewConfig> | undefined) => import("svelte/store").Unsubscriber;
|
|
25
|
+
set: (this: void, value: NewConfig) => void;
|
|
26
|
+
mockSetSubscribeValue: (value: NewConfig) => void;
|
|
13
27
|
};
|
|
14
28
|
export declare const mockActiveSubgraphsStore: {
|
|
15
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<Record<string,
|
|
16
|
-
set: (this: void, value: Record<string,
|
|
17
|
-
mockSetSubscribeValue: (value: Record<string,
|
|
29
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<Record<string, SubgraphCfg>>, invalidate?: import("svelte/store").Invalidator<Record<string, SubgraphCfg>> | undefined) => import("svelte/store").Unsubscriber;
|
|
30
|
+
set: (this: void, value: Record<string, SubgraphCfg>) => void;
|
|
31
|
+
mockSetSubscribeValue: (value: Record<string, SubgraphCfg>) => void;
|
|
18
32
|
};
|
|
19
33
|
export declare const mockAccountsStore: {
|
|
20
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<Record<string,
|
|
34
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<Record<string, AccountCfg>>, invalidate?: import("svelte/store").Invalidator<Record<string, AccountCfg>> | undefined) => import("svelte/store").Unsubscriber;
|
|
21
35
|
};
|
|
22
36
|
export declare const mockActiveAccountsItemsStore: {
|
|
23
37
|
subscribe: (this: void, run: import("svelte/store").Subscriber<Record<string, string>>, invalidate?: import("svelte/store").Invalidator<Record<string, string>> | undefined) => import("svelte/store").Unsubscriber;
|
|
24
38
|
set: (this: void, value: Record<string, string>) => void;
|
|
25
39
|
mockSetSubscribeValue: (value: Record<string, string>) => void;
|
|
26
40
|
};
|
|
27
|
-
export declare const
|
|
28
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<boolean
|
|
29
|
-
set: (this: void, value: boolean
|
|
30
|
-
mockSetSubscribeValue: (value: boolean
|
|
41
|
+
export declare const mockShowInactiveOrdersStore: {
|
|
42
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<boolean>, invalidate?: import("svelte/store").Invalidator<boolean> | undefined) => import("svelte/store").Unsubscriber;
|
|
43
|
+
set: (this: void, value: boolean) => void;
|
|
44
|
+
mockSetSubscribeValue: (value: boolean) => void;
|
|
31
45
|
};
|
|
32
46
|
export declare const mockOrderHashStore: {
|
|
33
47
|
subscribe: (this: void, run: import("svelte/store").Subscriber<string>, invalidate?: import("svelte/store").Invalidator<string> | undefined) => import("svelte/store").Unsubscriber;
|
|
@@ -59,12 +73,6 @@ export declare const mockSubgraphUrlStore: {
|
|
|
59
73
|
set: (this: void, value: string) => void;
|
|
60
74
|
mockSetSubscribeValue: (value: string) => void;
|
|
61
75
|
};
|
|
62
|
-
export declare const mockSignerAddressStore: {
|
|
63
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<string>, invalidate?: import("svelte/store").Invalidator<string> | undefined) => import("svelte/store").Unsubscriber;
|
|
64
|
-
set: (this: void, value: string) => void;
|
|
65
|
-
mockSetSubscribeValue: (value: string) => void;
|
|
66
|
-
update: (this: void, updater: import("svelte/store").Updater<string>) => void;
|
|
67
|
-
};
|
|
68
76
|
export declare const mockChainIdStore: {
|
|
69
77
|
subscribe: (this: void, run: import("svelte/store").Subscriber<number>, invalidate?: import("svelte/store").Invalidator<number> | undefined) => import("svelte/store").Unsubscriber;
|
|
70
78
|
set: (this: void, value: number) => void;
|
|
@@ -88,7 +96,66 @@ export declare const mockShowMyItemsOnlyStore: {
|
|
|
88
96
|
mockSetSubscribeValue: (value: boolean) => void;
|
|
89
97
|
};
|
|
90
98
|
export declare const mockPageStore: {
|
|
91
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
};
|
|
99
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<{
|
|
100
|
+
data: {
|
|
101
|
+
stores: {
|
|
102
|
+
settings: {};
|
|
103
|
+
};
|
|
104
|
+
dotrain: string;
|
|
105
|
+
deployment: {
|
|
106
|
+
key: string;
|
|
107
|
+
};
|
|
108
|
+
strategyDetail: {};
|
|
109
|
+
};
|
|
110
|
+
url: URL;
|
|
111
|
+
params: {};
|
|
112
|
+
form: {};
|
|
113
|
+
status: number;
|
|
114
|
+
error: null;
|
|
115
|
+
route: {
|
|
116
|
+
id: null;
|
|
117
|
+
};
|
|
118
|
+
}>, invalidate?: import("svelte/store").Invalidator<{
|
|
119
|
+
data: {
|
|
120
|
+
stores: {
|
|
121
|
+
settings: {};
|
|
122
|
+
};
|
|
123
|
+
dotrain: string;
|
|
124
|
+
deployment: {
|
|
125
|
+
key: string;
|
|
126
|
+
};
|
|
127
|
+
strategyDetail: {};
|
|
128
|
+
};
|
|
129
|
+
url: URL;
|
|
130
|
+
params: {};
|
|
131
|
+
form: {};
|
|
132
|
+
status: number;
|
|
133
|
+
error: null;
|
|
134
|
+
route: {
|
|
135
|
+
id: null;
|
|
136
|
+
};
|
|
137
|
+
}> | undefined) => import("svelte/store").Unsubscriber;
|
|
138
|
+
set: (this: void, value: {
|
|
139
|
+
data: {
|
|
140
|
+
stores: {
|
|
141
|
+
settings: {};
|
|
142
|
+
};
|
|
143
|
+
dotrain: string;
|
|
144
|
+
deployment: {
|
|
145
|
+
key: string;
|
|
146
|
+
};
|
|
147
|
+
strategyDetail: {};
|
|
148
|
+
};
|
|
149
|
+
url: URL;
|
|
150
|
+
params: {};
|
|
151
|
+
form: {};
|
|
152
|
+
status: number;
|
|
153
|
+
error: null;
|
|
154
|
+
route: {
|
|
155
|
+
id: null;
|
|
156
|
+
};
|
|
157
|
+
}) => void;
|
|
158
|
+
mockSetSubscribeValue: (newValue: Partial<typeof initialPageState>) => void;
|
|
159
|
+
reset: () => void;
|
|
160
|
+
};
|
|
161
|
+
export {};
|
package/dist/__mocks__/stores.js
CHANGED
|
@@ -1,30 +1,53 @@
|
|
|
1
|
+
import { parseYaml } from '@rainlanguage/orderbook';
|
|
1
2
|
import { writable } from 'svelte/store';
|
|
2
|
-
import
|
|
3
|
+
import settingsYamlContent from '../__fixtures__/settings.yaml?raw';
|
|
3
4
|
import {} from '@wagmi/core';
|
|
4
5
|
import { mockWeb3Config } from './mockWeb3Config';
|
|
6
|
+
if (import.meta.vitest) {
|
|
7
|
+
vi.mock('@rainlanguage/orderbook', async (importOriginal) => {
|
|
8
|
+
return {
|
|
9
|
+
...(await importOriginal())
|
|
10
|
+
};
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
// Parse the YAML settings
|
|
14
|
+
const parseResult = parseYaml([settingsYamlContent]);
|
|
15
|
+
if (parseResult.error) {
|
|
16
|
+
throw new Error(`Failed to parse settings YAML: ${parseResult.error.readableMsg}`);
|
|
17
|
+
}
|
|
18
|
+
const settingsFixture = parseResult.value;
|
|
19
|
+
const initialPageState = {
|
|
20
|
+
data: {
|
|
21
|
+
stores: { settings: {} },
|
|
22
|
+
dotrain: 'some dotrain content',
|
|
23
|
+
deployment: { key: 'deploy-key' },
|
|
24
|
+
strategyDetail: {}
|
|
25
|
+
},
|
|
26
|
+
url: new URL('http://localhost:3000/deploy'),
|
|
27
|
+
params: {},
|
|
28
|
+
form: {},
|
|
29
|
+
status: 200,
|
|
30
|
+
error: null,
|
|
31
|
+
route: {
|
|
32
|
+
id: null
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const mockPageWritable = writable(initialPageState);
|
|
5
36
|
const mockSettingsWritable = writable(settingsFixture);
|
|
6
37
|
const mockActiveSubgraphsWritable = writable({});
|
|
7
38
|
const mockAccountsWritable = writable({});
|
|
8
39
|
const mockActiveAccountsItemsWritable = writable({});
|
|
9
|
-
const
|
|
40
|
+
const mockShowInactiveOrdersWritable = writable(true);
|
|
10
41
|
const mockOrderHashWritable = writable('');
|
|
11
42
|
const mockHideZeroBalanceVaultsWritable = writable(false);
|
|
12
43
|
const mockActiveNetworkRefWritable = writable('');
|
|
13
44
|
const mockActiveOrderbookRefWritable = writable('');
|
|
14
45
|
const mockActiveAccountsWritable = writable({});
|
|
15
46
|
const mockSubgraphUrlWritable = writable('');
|
|
16
|
-
const mockWalletAddressMatchesOrBlankWritable = writable(() => false);
|
|
17
|
-
const mockSignerAddressWritable = writable('');
|
|
18
47
|
const mockChainIdWritable = writable(0);
|
|
19
|
-
const mockConnectedWritable = writable(
|
|
48
|
+
const mockConnectedWritable = writable(true);
|
|
20
49
|
const mockWagmiConfigWritable = writable(mockWeb3Config);
|
|
21
50
|
const mockShowMyItemsOnlyWritable = writable(false);
|
|
22
|
-
const mockPageWritable = writable();
|
|
23
|
-
export const mockWalletAddressMatchesOrBlankStore = {
|
|
24
|
-
subscribe: mockWalletAddressMatchesOrBlankWritable.subscribe,
|
|
25
|
-
set: mockWalletAddressMatchesOrBlankWritable.set,
|
|
26
|
-
mockSetSubscribeValue: (value) => mockWalletAddressMatchesOrBlankWritable.set(value)
|
|
27
|
-
};
|
|
28
51
|
export const mockSettingsStore = {
|
|
29
52
|
subscribe: mockSettingsWritable.subscribe,
|
|
30
53
|
set: mockSettingsWritable.set,
|
|
@@ -43,10 +66,10 @@ export const mockActiveAccountsItemsStore = {
|
|
|
43
66
|
set: mockActiveAccountsItemsWritable.set,
|
|
44
67
|
mockSetSubscribeValue: (value) => mockActiveAccountsItemsWritable.set(value)
|
|
45
68
|
};
|
|
46
|
-
export const
|
|
47
|
-
subscribe:
|
|
48
|
-
set:
|
|
49
|
-
mockSetSubscribeValue: (value) =>
|
|
69
|
+
export const mockShowInactiveOrdersStore = {
|
|
70
|
+
subscribe: mockShowInactiveOrdersWritable.subscribe,
|
|
71
|
+
set: mockShowInactiveOrdersWritable.set,
|
|
72
|
+
mockSetSubscribeValue: (value) => mockShowInactiveOrdersWritable.set(value)
|
|
50
73
|
};
|
|
51
74
|
export const mockOrderHashStore = {
|
|
52
75
|
subscribe: mockOrderHashWritable.subscribe,
|
|
@@ -78,12 +101,6 @@ export const mockSubgraphUrlStore = {
|
|
|
78
101
|
set: mockSubgraphUrlWritable.set,
|
|
79
102
|
mockSetSubscribeValue: (value) => mockSubgraphUrlWritable.set(value)
|
|
80
103
|
};
|
|
81
|
-
export const mockSignerAddressStore = {
|
|
82
|
-
subscribe: mockSignerAddressWritable.subscribe,
|
|
83
|
-
set: mockSignerAddressWritable.set,
|
|
84
|
-
mockSetSubscribeValue: (value) => mockSignerAddressWritable.set(value),
|
|
85
|
-
update: mockSignerAddressWritable.update
|
|
86
|
-
};
|
|
87
104
|
export const mockChainIdStore = {
|
|
88
105
|
subscribe: mockChainIdWritable.subscribe,
|
|
89
106
|
set: mockChainIdWritable.set,
|
|
@@ -109,5 +126,11 @@ export const mockShowMyItemsOnlyStore = {
|
|
|
109
126
|
export const mockPageStore = {
|
|
110
127
|
subscribe: mockPageWritable.subscribe,
|
|
111
128
|
set: mockPageWritable.set,
|
|
112
|
-
mockSetSubscribeValue: (
|
|
129
|
+
mockSetSubscribeValue: (newValue) => {
|
|
130
|
+
mockPageWritable.update((currentValue) => ({
|
|
131
|
+
...currentValue,
|
|
132
|
+
...newValue
|
|
133
|
+
}));
|
|
134
|
+
},
|
|
135
|
+
reset: () => mockPageWritable.set(initialPageState)
|
|
113
136
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import { bigintStringToHex } from "../utils/hex";
|
|
2
|
-
import
|
|
2
|
+
import Tooltip from "./Tooltip.svelte";
|
|
3
3
|
import { formatUnits } from "viem";
|
|
4
4
|
export let tokenVault;
|
|
5
5
|
export let subgraphName;
|
|
@@ -10,10 +10,10 @@ export let subgraphName;
|
|
|
10
10
|
data-testid="vault-link"
|
|
11
11
|
>
|
|
12
12
|
<div class="flex flex-col items-start gap-y-2">
|
|
13
|
-
<Tooltip triggeredBy=
|
|
13
|
+
<Tooltip triggeredBy={`#token-info-${tokenVault.vaultId}`}>
|
|
14
14
|
ID: <span class="font-mono">{bigintStringToHex(tokenVault.vaultId)}</span>
|
|
15
15
|
</Tooltip>
|
|
16
|
-
<a href={`/vaults/${subgraphName}-${tokenVault.id}`} id=
|
|
16
|
+
<a href={`/vaults/${subgraphName}-${tokenVault.id}`} id={`token-info-${tokenVault.vaultId}`}>
|
|
17
17
|
{tokenVault.token.name} ({tokenVault.token.symbol})
|
|
18
18
|
</a>
|
|
19
19
|
<span class="text-sm text-gray-500 dark:text-gray-400">
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script>import { Checkbox, Label } from "flowbite-svelte";
|
|
2
|
+
import { useAccount } from "../providers/wallet/useAccount";
|
|
2
3
|
export let showMyItemsOnly;
|
|
3
4
|
export let context;
|
|
4
|
-
|
|
5
|
+
const { account } = useAccount();
|
|
5
6
|
function handleShowMyItemsChange() {
|
|
6
7
|
$showMyItemsOnly = !$showMyItemsOnly;
|
|
7
8
|
}
|
|
@@ -18,6 +19,6 @@ function handleShowMyItemsChange() {
|
|
|
18
19
|
id="show-my-items"
|
|
19
20
|
checked={$showMyItemsOnly}
|
|
20
21
|
on:change={handleShowMyItemsChange}
|
|
21
|
-
disabled={!$
|
|
22
|
+
disabled={!$account}
|
|
22
23
|
/>
|
|
23
24
|
</div>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AppStoresInterface } from '../types/appStores';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
showMyItemsOnly:
|
|
5
|
+
showMyItemsOnly: AppStoresInterface["showMyItemsOnly"];
|
|
6
6
|
context: "orders" | "vaults";
|
|
7
|
-
signerAddress: Writable<string | null> | undefined;
|
|
8
7
|
};
|
|
9
8
|
events: {
|
|
10
9
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AppStoresInterface } from '../types/appStores';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
hideZeroBalanceVaults:
|
|
5
|
+
hideZeroBalanceVaults: AppStoresInterface["hideZeroBalanceVaults"];
|
|
6
6
|
};
|
|
7
7
|
events: {
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|