@rainlanguage/ui-components 0.0.1-alpha.24 → 0.0.1-alpha.240
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/README.md +14 -6
- package/dist/__fixtures__/settings.yaml +123 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte +4 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte.d.ts +18 -0
- package/dist/__mocks__/MockCodeMirrorEditor.svelte +17 -0
- package/dist/__mocks__/MockCodeMirrorEditor.svelte.d.ts +21 -0
- package/dist/__mocks__/MockComponent.js +1 -1
- package/dist/__mocks__/MockComponent.svelte +10 -2
- package/dist/__mocks__/MockComponent.svelte.d.ts +4 -1
- package/dist/__mocks__/mockWeb3Config.d.ts +1 -1
- package/dist/__mocks__/mockWeb3Config.js +10 -7
- package/dist/__mocks__/queries.js +9 -9
- package/dist/__mocks__/stores.d.ts +55 -45
- package/dist/__mocks__/stores.js +85 -68
- package/dist/app.css +3 -3
- package/dist/components/ButtonDarkMode.svelte +7 -1
- package/dist/components/ButtonLoading.svelte +1 -1
- package/dist/components/ButtonScrub.svelte +22 -0
- package/dist/components/ButtonScrub.svelte.d.ts +25 -0
- package/dist/components/ButtonVaultLink.svelte +12 -11
- package/dist/components/ButtonVaultLink.svelte.d.ts +4 -3
- package/dist/components/CheckboxInactiveOrdersVault.svelte +20 -0
- package/dist/components/CheckboxInactiveOrdersVault.svelte.d.ts +19 -0
- 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 +20 -12
- package/dist/components/CodeMirrorRainlang.svelte.d.ts +3 -2
- package/dist/components/EditableSpan.svelte +3 -14
- package/dist/components/EditableSpan.svelte.d.ts +0 -1
- package/dist/components/Hash.svelte +6 -5
- package/dist/components/License.svelte +5 -4
- package/dist/components/ListViewRaindexFilters.svelte +64 -0
- package/dist/components/ListViewRaindexFilters.svelte.d.ts +32 -0
- package/dist/components/LocalDbStatusBadge.svelte +27 -0
- package/dist/components/LocalDbStatusBadge.svelte.d.ts +19 -0
- package/dist/components/LocalDbStatusCard.svelte +43 -0
- package/dist/components/LocalDbStatusCard.svelte.d.ts +20 -0
- package/dist/components/LocalDbStatusModal.svelte +105 -0
- package/dist/components/LocalDbStatusModal.svelte.d.ts +21 -0
- package/dist/components/OrderOrVaultHash.svelte +12 -12
- package/dist/components/OrderOrVaultHash.svelte.d.ts +4 -4
- package/dist/components/PageHeader.svelte +1 -1
- package/dist/components/Sensitive.svelte +16 -0
- package/dist/components/Sensitive.svelte.d.ts +28 -0
- package/dist/components/TanstackAppTable.svelte +270 -60
- package/dist/components/TanstackAppTable.svelte.d.ts +15 -9
- 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/VaultBalanceChangeTypeFilter.svelte +23 -0
- package/dist/components/VaultBalanceChangeTypeFilter.svelte.d.ts +19 -0
- package/dist/components/VaultCard.svelte +18 -0
- package/dist/components/VaultCard.svelte.d.ts +19 -0
- package/dist/components/charts/LightweightChart.svelte +1 -1
- package/dist/components/charts/LightweightChart.svelte.d.ts +5 -5
- package/dist/components/charts/OrderTradesChart.svelte +319 -28
- package/dist/components/charts/OrderTradesChart.svelte.d.ts +4 -4
- package/dist/components/charts/TanstackLightweightChartLine.svelte +5 -9
- package/dist/components/charts/VaultBalanceChart.svelte +8 -26
- package/dist/components/charts/VaultBalanceChart.svelte.d.ts +1 -7
- 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 +3 -2
- package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +1 -4
- package/dist/components/deployment/DeploymentSectionHeader.svelte +7 -4
- package/dist/components/deployment/DeploymentSteps.svelte +196 -221
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +6 -12
- package/dist/components/deployment/DeploymentTile.svelte +2 -2
- package/dist/components/deployment/DeploymentTile.svelte.d.ts +1 -1
- package/dist/components/deployment/DeploymentsSection.svelte +15 -22
- package/dist/components/deployment/DeploymentsSection.svelte.d.ts +3 -2
- package/dist/components/deployment/DepositInput.svelte +10 -11
- package/dist/components/deployment/DepositInput.svelte.d.ts +2 -3
- package/dist/components/deployment/DisclaimerModal.svelte +6 -7
- package/dist/components/deployment/FieldDefinitionInput.svelte +10 -14
- package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +2 -3
- package/dist/components/deployment/InvalidOrdersSection.svelte +17 -0
- package/dist/components/deployment/InvalidOrdersSection.svelte.d.ts +19 -0
- package/dist/components/deployment/{StrategyPage.svelte → OrderPage.svelte} +15 -24
- package/dist/components/deployment/OrderPage.svelte.d.ts +21 -0
- package/dist/components/deployment/SelectToken.svelte +127 -50
- package/dist/components/deployment/SelectToken.svelte.d.ts +5 -4
- package/dist/components/deployment/TokenBalance.svelte +19 -0
- package/dist/components/deployment/TokenBalance.svelte.d.ts +19 -0
- package/dist/components/deployment/TokenIOInput.svelte +27 -17
- package/dist/components/deployment/TokenIOInput.svelte.d.ts +3 -3
- package/dist/components/deployment/TokenSelectionModal.svelte +148 -0
- package/dist/components/deployment/TokenSelectionModal.svelte.d.ts +20 -0
- package/dist/components/deployment/{ValidStrategiesSection.svelte → ValidOrdersSection.svelte} +7 -7
- package/dist/components/deployment/ValidOrdersSection.svelte.d.ts +19 -0
- package/dist/components/deployment/VaultIdInformation.svelte +17 -0
- package/dist/components/deployment/VaultIdInformation.svelte.d.ts +21 -0
- package/dist/components/detail/OrderDetail.svelte +220 -82
- package/dist/components/detail/OrderDetail.svelte.d.ts +21 -15
- package/dist/components/detail/TanstackOrderQuote.svelte +114 -46
- package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +14 -16
- package/dist/components/detail/VaultDetail.svelte +82 -79
- package/dist/components/detail/VaultDetail.svelte.d.ts +12 -18
- package/dist/components/dropdown/DropdownActiveNetworks.svelte +44 -0
- package/dist/components/dropdown/DropdownActiveNetworks.svelte.d.ts +19 -0
- package/dist/components/dropdown/DropdownCheckbox.svelte +4 -4
- package/dist/components/dropdown/DropdownRaindexesFilter.svelte +172 -0
- package/dist/components/dropdown/DropdownRaindexesFilter.svelte.d.ts +25 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte +152 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte.d.ts +28 -0
- package/dist/components/icon/Refresh.svelte +4 -2
- package/dist/components/icon/Refresh.svelte.d.ts +2 -0
- package/dist/components/input/InputOrderHash.svelte +1 -1
- package/dist/components/input/InputOrderHash.svelte.d.ts +3 -3
- package/dist/components/input/InputOwnerFilter.svelte +48 -0
- package/dist/components/input/InputOwnerFilter.svelte.d.ts +19 -0
- package/dist/components/input/InputRegistryUrl.svelte +36 -14
- package/dist/components/input/InputToken.svelte +2 -2
- package/dist/components/input/InputTokenAmount.svelte +30 -20
- package/dist/components/input/InputTokenAmount.svelte.d.ts +3 -3
- package/dist/components/tables/OrderAPY.svelte +6 -33
- package/dist/components/tables/OrderAPY.svelte.d.ts +1 -4
- package/dist/components/tables/OrderTradesListTable.svelte +132 -124
- package/dist/components/tables/OrderTradesListTable.svelte.d.ts +4 -4
- package/dist/components/tables/OrderVaultsVolTable.svelte +17 -22
- package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +2 -2
- package/dist/components/tables/OrdersListTable.svelte +206 -115
- package/dist/components/tables/OrdersListTable.svelte.d.ts +18 -23
- package/dist/components/tables/VaultBalanceChangesTable.svelte +83 -43
- package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +13 -11
- package/dist/components/tables/VaultsListTable.svelte +275 -150
- package/dist/components/tables/VaultsListTable.svelte.d.ts +24 -33
- package/dist/components/transactions/FixedBottomTransaction.svelte +64 -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 +11 -5
- package/dist/errors/DeploymentStepsError.js +13 -7
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/hooks/useLocalDb.d.ts +3 -0
- package/dist/hooks/useLocalDb.js +10 -0
- package/dist/hooks/useRaindexClient.d.ts +3 -0
- package/dist/hooks/useRaindexClient.js +11 -0
- package/dist/hooks/useRaindexOrderBuilder.d.ts +3 -0
- package/dist/hooks/useRaindexOrderBuilder.js +11 -0
- package/dist/index.d.ts +122 -91
- package/dist/index.js +118 -87
- package/dist/models/Transaction.d.ts +75 -0
- package/dist/models/Transaction.js +100 -0
- package/dist/providers/LocalDbProvider.svelte +8 -0
- package/dist/providers/LocalDbProvider.svelte.d.ts +21 -0
- package/dist/providers/RaindexClientProvider.svelte +8 -0
- package/dist/providers/RaindexClientProvider.svelte.d.ts +21 -0
- package/dist/providers/RaindexOrderBuilderProvider.svelte +8 -0
- package/dist/providers/RaindexOrderBuilderProvider.svelte.d.ts +21 -0
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte +8 -0
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte.d.ts +24 -0
- package/dist/providers/dotrainRegistry/context.d.ts +9 -0
- package/dist/providers/dotrainRegistry/context.js +43 -0
- package/dist/providers/dotrainRegistry/useDotrainRegistry.d.ts +5 -0
- package/dist/providers/dotrainRegistry/useDotrainRegistry.js +35 -0
- package/dist/providers/registry/RegistryManager.d.ts +65 -0
- package/dist/providers/registry/RegistryManager.js +134 -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 +234 -0
- package/dist/providers/transactions/TransactionManager.js +509 -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/keys.d.ts +1 -0
- package/dist/queries/keys.js +10 -9
- package/dist/queries/queryClient.d.ts +2 -2
- package/dist/queries/queryClient.js +16 -11
- package/dist/services/awaitTransactionIndexing.d.ts +107 -0
- package/dist/services/awaitTransactionIndexing.js +60 -0
- package/dist/services/getExplorerLink.d.ts +1 -1
- package/dist/services/getExplorerLink.js +3 -5
- package/dist/services/handleShareChoices.d.ts +2 -2
- package/dist/services/handleShareChoices.js +6 -5
- package/dist/services/historicalOrderCharts.d.ts +3 -3
- package/dist/services/historicalOrderCharts.js +364 -371
- package/dist/services/index.d.ts +5 -2
- package/dist/services/index.js +3 -1
- package/dist/services/loadRegistryUrl.d.ts +2 -0
- package/dist/services/loadRegistryUrl.js +22 -0
- package/dist/services/pairTradesChartData.d.ts +47 -0
- package/dist/services/pairTradesChartData.js +194 -0
- package/dist/services/registry.d.ts +5 -5
- package/dist/services/registry.js +17 -217
- package/dist/services/time.d.ts +12 -0
- package/dist/services/time.js +88 -6
- package/dist/services/validateAmount.d.ts +30 -0
- package/dist/services/validateAmount.js +53 -0
- package/dist/storesGeneric/cachedWritableStore.d.ts +57 -0
- package/dist/storesGeneric/cachedWritableStore.js +93 -0
- package/dist/storesGeneric/scrub.d.ts +14 -0
- package/dist/storesGeneric/scrub.js +22 -0
- package/dist/test/matchers.d.ts +2 -2
- package/dist/test/matchers.js +2 -2
- package/dist/types/account.d.ts +3 -0
- package/dist/types/appStores.d.ts +9 -16
- package/dist/types/modal.d.ts +26 -14
- package/dist/types/order.d.ts +10 -0
- package/dist/types/order.js +1 -0
- package/dist/types/toast.d.ts +11 -0
- package/dist/types/toast.js +1 -0
- package/dist/types/tokenBalance.d.ts +6 -0
- package/dist/types/tokenBalance.js +1 -0
- package/dist/types/transaction.d.ts +67 -22
- package/dist/types/transaction.js +31 -1
- package/dist/utils/breadcrumbs.js +2 -2
- package/dist/utils/codeMirrorThemes.js +80 -74
- package/dist/utils/configHelpers.d.ts +4 -0
- package/dist/utils/configHelpers.js +21 -0
- package/dist/utils/constructHashLink.d.ts +24 -0
- package/dist/utils/constructHashLink.js +117 -0
- package/dist/utils/getNetworkName.d.ts +1 -0
- package/dist/utils/getNetworkName.js +13 -0
- package/dist/utils/hex.js +1 -1
- package/dist/utils/lightweightChartsThemes.d.ts +1 -1
- package/dist/utils/lightweightChartsThemes.js +11 -11
- package/dist/utils/localDbStatus.d.ts +26 -0
- package/dist/utils/localDbStatus.js +22 -0
- package/dist/utils/number.d.ts +0 -7
- package/dist/utils/number.js +5 -30
- package/dist/utils/stripTrailingWhitespace.d.ts +16 -0
- package/dist/utils/stripTrailingWhitespace.js +22 -0
- package/dist/utils/tokens.d.ts +2 -0
- package/dist/utils/tokens.js +3 -0
- package/dist/utils/vaultBalanceChangeLabels.d.ts +4 -0
- package/dist/utils/vaultBalanceChangeLabels.js +18 -0
- package/package.json +89 -84
- package/dist/__fixtures__/orderDetail.d.ts +0 -99
- package/dist/__fixtures__/orderDetail.js +0 -204
- 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/__mocks__/settings.d.ts +0 -3
- package/dist/__mocks__/settings.js +0 -37
- package/dist/components/CheckboxMyItemsOnly.svelte +0 -23
- package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +0 -21
- package/dist/components/ListViewOrderbookFilters.svelte +0 -58
- package/dist/components/ListViewOrderbookFilters.svelte.d.ts +0 -28
- package/dist/components/deployment/InvalidStrategiesSection.svelte +0 -19
- package/dist/components/deployment/InvalidStrategiesSection.svelte.d.ts +0 -19
- package/dist/components/deployment/StrategyPage.svelte.d.ts +0 -19
- package/dist/components/deployment/ValidStrategiesSection.svelte.d.ts +0 -19
- package/dist/components/deployment/getDeploymentTransactionArgs.d.ts +0 -17
- package/dist/components/deployment/getDeploymentTransactionArgs.js +0 -28
- package/dist/components/detail/DepositOrWithdrawButtons.svelte +0 -44
- package/dist/components/detail/DepositOrWithdrawButtons.svelte.d.ts +0 -26
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte +0 -38
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte.d.ts +0 -21
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte +0 -15
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +0 -20
- package/dist/components/dropdown/DropdownOrderStatus.svelte +0 -31
- package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +0 -19
- package/dist/hooks/useGui.d.ts +0 -3
- package/dist/hooks/useGui.js +0 -11
- package/dist/providers/GuiProvider.svelte +0 -8
- package/dist/providers/GuiProvider.svelte.d.ts +0 -21
- package/dist/stores/transactionStore.d.ts +0 -98
- package/dist/stores/transactionStore.js +0 -303
- package/dist/types/strategy.d.ts +0 -10
- package/dist/utils/time.d.ts +0 -12
- package/dist/utils/time.js +0 -27
- package/dist/utils/vault.d.ts +0 -2
- package/dist/utils/vault.js +0 -29
- /package/dist/types/{strategy.js → account.js} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script>import { getNetworkName } from "../../utils/getNetworkName";
|
|
2
|
+
import { goto } from "$app/navigation";
|
|
2
3
|
import { DotsVerticalOutline } from "flowbite-svelte-icons";
|
|
3
|
-
import {} from "@
|
|
4
|
-
import {
|
|
5
|
-
import { getOrders } from "@rainlanguage/orderbook/js_api";
|
|
4
|
+
import { createInfiniteQuery, createQuery } from "@tanstack/svelte-query";
|
|
5
|
+
import { RaindexOrder } from "@rainlanguage/raindex";
|
|
6
6
|
import TanstackAppTable from "../TanstackAppTable.svelte";
|
|
7
|
-
import { formatTimestampSecondsAsLocal } from "../../
|
|
8
|
-
import
|
|
7
|
+
import { formatTimestampSecondsAsLocal } from "../../services/time";
|
|
8
|
+
import ListViewRaindexFilters from "../ListViewRaindexFilters.svelte";
|
|
9
9
|
import Hash, { HashType } from "../Hash.svelte";
|
|
10
|
+
import VaultCard from "../VaultCard.svelte";
|
|
10
11
|
import { DEFAULT_PAGE_SIZE, DEFAULT_REFRESH_INTERVAL } from "../../queries/constants";
|
|
11
|
-
import { QKEY_ORDERS } from "../../queries/keys";
|
|
12
|
+
import { QKEY_ORDERS, QKEY_TOKENS } from "../../queries/keys";
|
|
12
13
|
import {
|
|
13
14
|
Badge,
|
|
14
15
|
Button,
|
|
@@ -17,82 +18,105 @@ import {
|
|
|
17
18
|
TableBodyCell,
|
|
18
19
|
TableHeadCell
|
|
19
20
|
} from "flowbite-svelte";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export let
|
|
25
|
-
export let
|
|
26
|
-
export let
|
|
21
|
+
import { useAccount } from "../../providers/wallet/useAccount";
|
|
22
|
+
import { useRaindexClient } from "../../hooks/useRaindexClient";
|
|
23
|
+
import { getAllContexts } from "svelte";
|
|
24
|
+
const context = getAllContexts();
|
|
25
|
+
export let handleOrderRemoveModal = void 0;
|
|
26
|
+
export let handleTakeOrderModal = void 0;
|
|
27
|
+
export let selectedChainIds;
|
|
28
|
+
export let showInactiveOrders;
|
|
27
29
|
export let orderHash;
|
|
28
30
|
export let hideZeroBalanceVaults;
|
|
29
|
-
export let
|
|
30
|
-
export let
|
|
31
|
-
export let
|
|
32
|
-
export let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
export let hideInactiveOrdersVaults;
|
|
32
|
+
export let activeTokens;
|
|
33
|
+
export let activeRaindexAddresses;
|
|
34
|
+
export let ownerFilter;
|
|
35
|
+
const { matchesAccount, account } = useAccount();
|
|
36
|
+
const raindexClient = useRaindexClient();
|
|
37
|
+
$: ownerAddress = $ownerFilter?.trim() || "";
|
|
38
|
+
$: owners = ownerAddress ? [ownerAddress] : [];
|
|
39
|
+
$: tokensQuery = createQuery({
|
|
40
|
+
queryKey: [QKEY_TOKENS, $selectedChainIds],
|
|
41
|
+
queryFn: async () => {
|
|
42
|
+
const result = await raindexClient.getAllVaultTokens($selectedChainIds);
|
|
43
|
+
if (result.error) throw new Error(result.error.readableMsg);
|
|
44
|
+
return result.value;
|
|
45
|
+
},
|
|
46
|
+
enabled: true
|
|
47
|
+
});
|
|
48
|
+
$: selectedTokens = $activeTokens?.filter(
|
|
49
|
+
(address) => !$tokensQuery.data || $tokensQuery.data.some((t) => t.address === address)
|
|
50
|
+
) ?? [];
|
|
51
|
+
$: raindexesMap = raindexClient.getAllRaindexes()?.value ?? /* @__PURE__ */ new Map();
|
|
52
|
+
$: availableRaindexAddresses = (() => {
|
|
53
|
+
const addrs = [];
|
|
54
|
+
raindexesMap.forEach((cfg) => {
|
|
55
|
+
if ($selectedChainIds.length === 0 || $selectedChainIds.includes(cfg.network.chainId)) {
|
|
56
|
+
addrs.push(cfg.address.toLowerCase());
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return addrs;
|
|
60
|
+
})();
|
|
61
|
+
$: selectedRaindexAddresses = $activeRaindexAddresses?.filter(
|
|
62
|
+
(address) => availableRaindexAddresses.includes(address.toLowerCase())
|
|
63
|
+
) ?? [];
|
|
41
64
|
$: query = createInfiniteQuery({
|
|
42
65
|
queryKey: [
|
|
43
66
|
QKEY_ORDERS,
|
|
44
|
-
$
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
67
|
+
$selectedChainIds,
|
|
68
|
+
ownerAddress,
|
|
69
|
+
$showInactiveOrders,
|
|
70
|
+
$orderHash,
|
|
71
|
+
selectedTokens,
|
|
72
|
+
selectedRaindexAddresses
|
|
50
73
|
],
|
|
51
|
-
queryFn: ({ pageParam }) => {
|
|
52
|
-
|
|
53
|
-
|
|
74
|
+
queryFn: async ({ pageParam }) => {
|
|
75
|
+
const result = await raindexClient.getOrders(
|
|
76
|
+
$selectedChainIds,
|
|
54
77
|
{
|
|
55
78
|
owners,
|
|
56
|
-
active: $
|
|
57
|
-
orderHash: $orderHash || void 0
|
|
79
|
+
active: $showInactiveOrders ? void 0 : true,
|
|
80
|
+
orderHash: $orderHash || void 0,
|
|
81
|
+
tokens: selectedTokens.length > 0 ? { inputs: selectedTokens, outputs: selectedTokens } : void 0,
|
|
82
|
+
raindexAddresses: selectedRaindexAddresses.length > 0 ? selectedRaindexAddresses : void 0
|
|
58
83
|
},
|
|
59
|
-
|
|
84
|
+
pageParam + 1
|
|
60
85
|
);
|
|
86
|
+
if (result.error) throw new Error(result.error.readableMsg);
|
|
87
|
+
return result.value;
|
|
61
88
|
},
|
|
62
89
|
initialPageParam: 0,
|
|
63
90
|
getNextPageParam(lastPage, _allPages, lastPageParam) {
|
|
64
|
-
return lastPage.length === DEFAULT_PAGE_SIZE ? lastPageParam + 1 : void 0;
|
|
91
|
+
return lastPage.orders.length === DEFAULT_PAGE_SIZE ? lastPageParam + 1 : void 0;
|
|
65
92
|
},
|
|
66
93
|
refetchInterval: DEFAULT_REFRESH_INTERVAL,
|
|
67
94
|
enabled: true
|
|
68
95
|
});
|
|
69
96
|
const AppTable = TanstackAppTable;
|
|
70
|
-
$: isVaultsPage = currentRoute.startsWith("/vaults");
|
|
71
|
-
$: isOrdersPage = currentRoute.startsWith("/orders");
|
|
72
97
|
</script>
|
|
73
98
|
|
|
74
|
-
<
|
|
75
|
-
{
|
|
76
|
-
{
|
|
77
|
-
{accounts}
|
|
78
|
-
{activeAccountsItems}
|
|
79
|
-
{showMyItemsOnly}
|
|
80
|
-
{activeOrderStatus}
|
|
99
|
+
<ListViewRaindexFilters
|
|
100
|
+
{selectedChainIds}
|
|
101
|
+
{showInactiveOrders}
|
|
81
102
|
{orderHash}
|
|
82
103
|
{hideZeroBalanceVaults}
|
|
83
|
-
{
|
|
84
|
-
{
|
|
85
|
-
{
|
|
104
|
+
{hideInactiveOrdersVaults}
|
|
105
|
+
{tokensQuery}
|
|
106
|
+
{activeTokens}
|
|
107
|
+
{selectedTokens}
|
|
108
|
+
{activeRaindexAddresses}
|
|
109
|
+
{selectedRaindexAddresses}
|
|
110
|
+
{ownerFilter}
|
|
86
111
|
/>
|
|
87
112
|
|
|
88
113
|
<AppTable
|
|
89
114
|
{query}
|
|
90
|
-
queryKey={
|
|
115
|
+
queryKey={QKEY_ORDERS}
|
|
91
116
|
emptyMessage="No Orders Found"
|
|
117
|
+
dataSelector={(page) => page.orders}
|
|
92
118
|
on:clickRow={(e) => {
|
|
93
|
-
|
|
94
|
-
activeOrderbookRef.set(e.detail.item.subgraphName);
|
|
95
|
-
goto(`/orders/${e.detail.item.subgraphName}-${e.detail.item.order.orderHash}`);
|
|
119
|
+
goto(`/orders/${e.detail.item.chainId}-${e.detail.item.raindex}-${e.detail.item.orderHash}`);
|
|
96
120
|
}}
|
|
97
121
|
>
|
|
98
122
|
<svelte:fragment slot="title">
|
|
@@ -103,82 +127,149 @@ $: isOrdersPage = currentRoute.startsWith("/orders");
|
|
|
103
127
|
</svelte:fragment>
|
|
104
128
|
|
|
105
129
|
<svelte:fragment slot="head">
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
130
|
+
{#if $account && (handleTakeOrderModal || handleOrderRemoveModal)}
|
|
131
|
+
<TableHeadCell data-testid="orderListHeadingOrderInfo" padding="p-4" class="w-[15%]"
|
|
132
|
+
>Order Info</TableHeadCell
|
|
133
|
+
>
|
|
134
|
+
<TableHeadCell data-testid="orderListHeadingAddresses" padding="p-4" class="w-[18%]"
|
|
135
|
+
>Addresses</TableHeadCell
|
|
136
|
+
>
|
|
137
|
+
<TableHeadCell data-testid="orderListHeadingInputs" padding="px-2 py-4" class="w-[23.5%]"
|
|
138
|
+
>Input Token(s)</TableHeadCell
|
|
139
|
+
>
|
|
140
|
+
<TableHeadCell data-testid="orderListHeadingOutputs" padding="px-2 py-4" class="w-[23.5%]"
|
|
141
|
+
>Output Token(s)</TableHeadCell
|
|
142
|
+
>
|
|
143
|
+
<TableHeadCell data-testid="orderListHeadingTrades" padding="px-2 py-4" class="w-[10%]"
|
|
144
|
+
>Trades</TableHeadCell
|
|
145
|
+
>
|
|
146
|
+
<TableHeadCell data-testid="orderListHeadingActions" padding="px-2 py-4" class="w-[10%]"
|
|
147
|
+
>Actions</TableHeadCell
|
|
148
|
+
>
|
|
149
|
+
{:else}
|
|
150
|
+
<TableHeadCell data-testid="orderListHeadingOrderInfo" padding="p-4" class="w-[15%]"
|
|
151
|
+
>Order Info</TableHeadCell
|
|
152
|
+
>
|
|
153
|
+
<TableHeadCell data-testid="orderListHeadingAddresses" padding="p-4" class="w-[20%]"
|
|
154
|
+
>Addresses</TableHeadCell
|
|
155
|
+
>
|
|
156
|
+
<TableHeadCell data-testid="orderListHeadingInputs" padding="px-2 py-4" class="w-[27.5%]"
|
|
157
|
+
>Input Token(s)</TableHeadCell
|
|
158
|
+
>
|
|
159
|
+
<TableHeadCell data-testid="orderListHeadingOutputs" padding="px-2 py-4" class="w-[27.5%]"
|
|
160
|
+
>Output Token(s)</TableHeadCell
|
|
161
|
+
>
|
|
162
|
+
<TableHeadCell data-testid="orderListHeadingTrades" padding="px-2 py-4" class="w-[10%]"
|
|
163
|
+
>Trades</TableHeadCell
|
|
164
|
+
>
|
|
165
|
+
{/if}
|
|
119
166
|
</svelte:fragment>
|
|
120
167
|
|
|
121
168
|
<svelte:fragment slot="bodyRow" let:item>
|
|
122
|
-
<TableBodyCell data-testid="
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
<Hash type={HashType.Wallet} value={item.order.owner} />
|
|
169
|
+
<TableBodyCell data-testid="orderListRowOrderInfo" tdClass="px-4 py-2">
|
|
170
|
+
<div class="flex flex-col gap-1">
|
|
171
|
+
<div class="flex items-center gap-2">
|
|
172
|
+
<span class="text-sm font-medium">{getNetworkName(Number(item.chainId))}</span>
|
|
173
|
+
{#if item.active}
|
|
174
|
+
<Badge color="green">Active</Badge>
|
|
175
|
+
{:else}
|
|
176
|
+
<Badge color="yellow">Inactive</Badge>
|
|
177
|
+
{/if}
|
|
178
|
+
</div>
|
|
179
|
+
<span class="text-xs text-gray-500 dark:text-gray-400">
|
|
180
|
+
Added: {formatTimestampSecondsAsLocal(item.timestampAdded)}
|
|
181
|
+
</span>
|
|
182
|
+
</div>
|
|
137
183
|
</TableBodyCell>
|
|
138
|
-
<TableBodyCell data-testid="
|
|
139
|
-
<
|
|
184
|
+
<TableBodyCell data-testid="orderListRowAddresses" tdClass="px-4 py-2">
|
|
185
|
+
<div class="flex flex-col gap-1 text-sm">
|
|
186
|
+
<div class="flex items-center gap-1">
|
|
187
|
+
<span class="text-gray-500 dark:text-gray-400">Order:</span>
|
|
188
|
+
<Hash type={HashType.Identifier} value={item.orderHash} />
|
|
189
|
+
</div>
|
|
190
|
+
<div class="flex items-center gap-1">
|
|
191
|
+
<span class="text-gray-500 dark:text-gray-400">Owner:</span>
|
|
192
|
+
<Hash type={HashType.Wallet} value={item.owner} />
|
|
193
|
+
</div>
|
|
194
|
+
<div class="flex items-center gap-1">
|
|
195
|
+
<span class="text-gray-500 dark:text-gray-400">Raindex:</span>
|
|
196
|
+
<Hash type={HashType.Identifier} value={item.raindex} />
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
140
199
|
</TableBodyCell>
|
|
141
|
-
|
|
142
|
-
|
|
200
|
+
|
|
201
|
+
<TableBodyCell data-testid="orderListRowInputs" tdClass="p-2 whitespace-normal">
|
|
202
|
+
<div class="grid w-full grid-cols-1 gap-2 sm:grid-cols-2">
|
|
203
|
+
{#each item.inputsList.items as vault}
|
|
204
|
+
<VaultCard {vault} />
|
|
205
|
+
{/each}
|
|
206
|
+
{#each item.inputsOutputsList.items as vault}
|
|
207
|
+
{#if !item.inputsList.items.find((v) => v.id === vault.id)}
|
|
208
|
+
<VaultCard {vault} />
|
|
209
|
+
{/if}
|
|
210
|
+
{/each}
|
|
211
|
+
</div>
|
|
143
212
|
</TableBodyCell>
|
|
144
|
-
|
|
145
|
-
|
|
213
|
+
|
|
214
|
+
<TableBodyCell data-testid="orderListRowOutputs" tdClass="p-2 whitespace-normal">
|
|
215
|
+
<div class="grid w-full grid-cols-1 gap-2 sm:grid-cols-2">
|
|
216
|
+
{#each item.outputsList.items as vault}
|
|
217
|
+
<VaultCard {vault} />
|
|
218
|
+
{/each}
|
|
219
|
+
{#each item.inputsOutputsList.items as vault}
|
|
220
|
+
{#if !item.outputsList.items.find((v) => v.id === vault.id)}
|
|
221
|
+
<VaultCard {vault} />
|
|
222
|
+
{/if}
|
|
223
|
+
{/each}
|
|
224
|
+
</div>
|
|
146
225
|
</TableBodyCell>
|
|
147
|
-
|
|
148
|
-
|
|
226
|
+
|
|
227
|
+
<TableBodyCell data-testid="orderListRowTrades" tdClass="break-word p-2">
|
|
228
|
+
{item.tradesCount}
|
|
149
229
|
</TableBodyCell>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<div data-testid="wallet-actions">
|
|
155
|
-
<TableBodyCell tdClass="px-0 text-right">
|
|
156
|
-
{#if $walletAddressMatchesOrBlank(item.order.owner) && item.order.active}
|
|
230
|
+
{#if $account && (handleTakeOrderModal || handleOrderRemoveModal)}
|
|
231
|
+
<TableBodyCell data-testid="orderListRowActions" tdClass="px-2 py-2">
|
|
232
|
+
{#if item.active}
|
|
233
|
+
{#if handleTakeOrderModal}
|
|
157
234
|
<Button
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
data-testid={`order-menu-${item.order.id}`}
|
|
161
|
-
id={`order-menu-${item.order.id}`}
|
|
162
|
-
class="mr-2 border-none px-2"
|
|
235
|
+
size="xs"
|
|
236
|
+
data-testid={`order-take-${item.id}`}
|
|
163
237
|
on:click={(e) => {
|
|
164
238
|
e.stopPropagation();
|
|
239
|
+
handleTakeOrderModal(item, $query.refetch, context);
|
|
165
240
|
}}
|
|
166
241
|
>
|
|
167
|
-
|
|
242
|
+
Take Order
|
|
168
243
|
</Button>
|
|
169
244
|
{/if}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
245
|
+
{#if matchesAccount(item.owner) && handleOrderRemoveModal}
|
|
246
|
+
<div data-testid="wallet-actions">
|
|
247
|
+
<Button
|
|
248
|
+
color="alternative"
|
|
249
|
+
outline={false}
|
|
250
|
+
data-testid={`order-menu-${item.id}`}
|
|
251
|
+
id={`order-menu-${item.id}`}
|
|
252
|
+
class="border-none px-2"
|
|
253
|
+
title="Order actions"
|
|
254
|
+
aria-label="Order actions"
|
|
255
|
+
on:click={(e) => {
|
|
256
|
+
e.stopPropagation();
|
|
257
|
+
}}
|
|
258
|
+
>
|
|
259
|
+
<DotsVerticalOutline class="dark:text-white" />
|
|
260
|
+
</Button>
|
|
261
|
+
<Dropdown placement="bottom-end" triggeredBy={`#order-menu-${item.id}`}>
|
|
262
|
+
<DropdownItem
|
|
263
|
+
on:click={(e) => {
|
|
264
|
+
e.stopPropagation();
|
|
265
|
+
handleOrderRemoveModal(item, $query.refetch, context);
|
|
266
|
+
}}>Remove</DropdownItem
|
|
267
|
+
>
|
|
268
|
+
</Dropdown>
|
|
269
|
+
</div>
|
|
270
|
+
{/if}
|
|
180
271
|
{/if}
|
|
181
|
-
</
|
|
272
|
+
</TableBodyCell>
|
|
182
273
|
{/if}
|
|
183
274
|
</svelte:fragment>
|
|
184
275
|
</AppTable>
|
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { AppStoresInterface } from '../../types/appStores';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
props(): {
|
|
6
|
-
walletAddressMatchesOrBlank?: any;
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
7
5
|
handleOrderRemoveModal?: any;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
activeAccountsItems: AppStoresInterface["activeAccountsItems"] | undefined;
|
|
12
|
-
activeOrderStatus: AppStoresInterface["activeOrderStatus"];
|
|
6
|
+
handleTakeOrderModal?: any;
|
|
7
|
+
selectedChainIds: AppStoresInterface["selectedChainIds"];
|
|
8
|
+
showInactiveOrders: AppStoresInterface["showInactiveOrders"];
|
|
13
9
|
orderHash: AppStoresInterface["orderHash"];
|
|
14
10
|
hideZeroBalanceVaults: AppStoresInterface["hideZeroBalanceVaults"];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
activeOrderbookRef: AppStoresInterface["activeOrderbookRef"];
|
|
11
|
+
hideInactiveOrdersVaults: AppStoresInterface["hideInactiveOrdersVaults"];
|
|
12
|
+
activeTokens: AppStoresInterface["activeTokens"];
|
|
13
|
+
activeRaindexAddresses: AppStoresInterface["activeRaindexAddresses"];
|
|
14
|
+
ownerFilter: AppStoresInterface["ownerFilter"];
|
|
20
15
|
};
|
|
21
|
-
events
|
|
16
|
+
events: {
|
|
22
17
|
[evt: string]: CustomEvent<any>;
|
|
23
18
|
};
|
|
24
|
-
slots
|
|
19
|
+
slots: {
|
|
25
20
|
filters: {};
|
|
26
21
|
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export type
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
exports?: {} | undefined;
|
|
23
|
+
bindings?: string | undefined;
|
|
24
|
+
};
|
|
25
|
+
export type OrdersListTableProps = typeof __propDef.props;
|
|
26
|
+
export type OrdersListTableEvents = typeof __propDef.events;
|
|
27
|
+
export type OrdersListTableSlots = typeof __propDef.slots;
|
|
28
|
+
export default class OrdersListTable extends SvelteComponent<OrdersListTableProps, OrdersListTableEvents, OrdersListTableSlots> {
|
|
34
29
|
}
|
|
35
30
|
export {};
|
|
@@ -1,74 +1,114 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import { formatUnits } from "viem";
|
|
1
|
+
<script>import { Badge, Heading, TableHeadCell, TableBodyCell } from "flowbite-svelte";
|
|
3
2
|
import { createInfiniteQuery } from "@tanstack/svelte-query";
|
|
4
3
|
import {
|
|
5
|
-
|
|
6
|
-
} from "@rainlanguage/
|
|
7
|
-
import { formatTimestampSecondsAsLocal } from "../../
|
|
4
|
+
RaindexVault
|
|
5
|
+
} from "@rainlanguage/raindex";
|
|
6
|
+
import { formatTimestampSecondsAsLocal } from "../../services/time";
|
|
8
7
|
import Hash, { HashType } from "../Hash.svelte";
|
|
9
8
|
import { QKEY_VAULT_CHANGES } from "../../queries/keys";
|
|
10
9
|
import { DEFAULT_PAGE_SIZE } from "../../queries/constants";
|
|
11
10
|
import TanstackAppTable from "../TanstackAppTable.svelte";
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
import Tooltip from "../Tooltip.svelte";
|
|
12
|
+
import VaultBalanceChangeTypeFilter from "../VaultBalanceChangeTypeFilter.svelte";
|
|
13
|
+
function getTypeBadgeColor(type) {
|
|
14
|
+
const lowerType = type.toLowerCase();
|
|
15
|
+
if (lowerType.includes("deposit")) return "green";
|
|
16
|
+
if (lowerType.includes("withdrawal")) return "yellow";
|
|
17
|
+
if (lowerType.includes("bounty")) return "purple";
|
|
18
|
+
if (lowerType.includes("trade") || lowerType.includes("takeorder")) return "blue";
|
|
19
|
+
if (lowerType.includes("clear")) return "pink";
|
|
20
|
+
return "dark";
|
|
21
|
+
}
|
|
22
|
+
export let vault;
|
|
23
|
+
let filterTypes = void 0;
|
|
14
24
|
$: balanceChangesQuery = createInfiniteQuery({
|
|
15
|
-
queryKey: [id, QKEY_VAULT_CHANGES + id],
|
|
16
|
-
queryFn: ({ pageParam }) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
25
|
+
queryKey: [vault.id, QKEY_VAULT_CHANGES + vault.id, filterTypes],
|
|
26
|
+
queryFn: async ({ pageParam }) => {
|
|
27
|
+
const result = await vault.getBalanceChanges(pageParam + 1, filterTypes);
|
|
28
|
+
if (result.error) throw new Error(result.error.msg);
|
|
29
|
+
return result.value;
|
|
21
30
|
},
|
|
22
31
|
initialPageParam: 0,
|
|
23
32
|
getNextPageParam(lastPage, _allPages, lastPageParam) {
|
|
24
33
|
return lastPage.length === DEFAULT_PAGE_SIZE ? lastPageParam + 1 : void 0;
|
|
25
|
-
}
|
|
26
|
-
enabled: !!subgraphUrl
|
|
34
|
+
}
|
|
27
35
|
});
|
|
28
36
|
const AppTable = TanstackAppTable;
|
|
29
37
|
</script>
|
|
30
38
|
|
|
39
|
+
<div class="flex w-full justify-end">
|
|
40
|
+
<VaultBalanceChangeTypeFilter bind:value={filterTypes} />
|
|
41
|
+
</div>
|
|
42
|
+
|
|
31
43
|
<AppTable
|
|
32
44
|
query={balanceChangesQuery}
|
|
33
|
-
queryKey={
|
|
34
|
-
emptyMessage="No
|
|
45
|
+
queryKey={vault.id}
|
|
46
|
+
emptyMessage="No balance changes found"
|
|
35
47
|
rowHoverable={false}
|
|
36
48
|
>
|
|
37
49
|
<svelte:fragment slot="title">
|
|
38
|
-
<Heading tag="h5" class="mb-4 mt-6 font-normal">Vault
|
|
50
|
+
<Heading tag="h5" class="mb-4 mt-6 font-normal">Vault balance changes</Heading>
|
|
39
51
|
</svelte:fragment>
|
|
40
52
|
<svelte:fragment slot="head">
|
|
41
|
-
<TableHeadCell padding="p-4">
|
|
42
|
-
<TableHeadCell padding="p-
|
|
43
|
-
<TableHeadCell padding="p-
|
|
44
|
-
<TableHeadCell padding="p-
|
|
45
|
-
<TableHeadCell padding="p-0">Balance</TableHeadCell>
|
|
46
|
-
<TableHeadCell padding="p--">Type</TableHeadCell>
|
|
53
|
+
<TableHeadCell padding="p-4" class="w-[18%]">Info</TableHeadCell>
|
|
54
|
+
<TableHeadCell padding="p-4" class="w-[22%]">Transaction</TableHeadCell>
|
|
55
|
+
<TableHeadCell padding="p-2" class="w-[30%]">Balance Change</TableHeadCell>
|
|
56
|
+
<TableHeadCell padding="p-2" class="w-[30%]">New Balance</TableHeadCell>
|
|
47
57
|
</svelte:fragment>
|
|
48
58
|
|
|
49
59
|
<svelte:fragment slot="bodyRow" let:item>
|
|
50
|
-
<TableBodyCell tdClass="px-4 py-2" data-testid="
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
<TableBodyCell tdClass="px-4 py-2" data-testid="vaultBalanceChangesTableInfo">
|
|
61
|
+
<div class="flex flex-col gap-1 overflow-hidden">
|
|
62
|
+
<div class="flex">
|
|
63
|
+
<Badge
|
|
64
|
+
id={`type-${item.transaction.id}`}
|
|
65
|
+
class="truncate"
|
|
66
|
+
color={getTypeBadgeColor(item.type)}>{item.typeDisplayName}</Badge
|
|
67
|
+
>
|
|
68
|
+
<Tooltip triggeredBy={`#type-${item.transaction.id}`}>
|
|
69
|
+
{item.typeDisplayName}
|
|
70
|
+
</Tooltip>
|
|
71
|
+
</div>
|
|
72
|
+
<span class="text-xs text-gray-500 dark:text-gray-400">
|
|
73
|
+
{formatTimestampSecondsAsLocal(BigInt(item.timestamp))}
|
|
74
|
+
</span>
|
|
75
|
+
</div>
|
|
58
76
|
</TableBodyCell>
|
|
59
|
-
<TableBodyCell
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
77
|
+
<TableBodyCell tdClass="px-4 py-2" data-testid="vaultBalanceChangesTableTx">
|
|
78
|
+
<div class="flex flex-col gap-1 text-sm">
|
|
79
|
+
<div class="flex items-center gap-1">
|
|
80
|
+
<span class="text-gray-500 dark:text-gray-400">Sender:</span>
|
|
81
|
+
<Hash type={HashType.Wallet} value={item.transaction.from} />
|
|
82
|
+
</div>
|
|
83
|
+
<div class="flex items-center gap-1">
|
|
84
|
+
<span class="text-gray-500 dark:text-gray-400">Tx:</span>
|
|
85
|
+
<Hash type={HashType.Transaction} value={item.transaction.id} />
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
65
88
|
</TableBodyCell>
|
|
66
|
-
<TableBodyCell tdClass="
|
|
67
|
-
|
|
68
|
-
|
|
89
|
+
<TableBodyCell tdClass="p-2" data-testid="vaultBalanceChangesTableBalanceChange">
|
|
90
|
+
<div class="flex flex-col overflow-hidden">
|
|
91
|
+
<span class="truncate font-medium">{item.token.symbol}</span>
|
|
92
|
+
<span
|
|
93
|
+
id={`change-${item.transaction.id}`}
|
|
94
|
+
class="truncate text-sm text-gray-500 dark:text-gray-400">{item.formattedAmount}</span
|
|
95
|
+
>
|
|
96
|
+
<Tooltip triggeredBy={`#change-${item.transaction.id}`}>
|
|
97
|
+
{`${item.formattedAmount} ${item.token.symbol}`}
|
|
98
|
+
</Tooltip>
|
|
99
|
+
</div>
|
|
69
100
|
</TableBodyCell>
|
|
70
|
-
<TableBodyCell tdClass="
|
|
71
|
-
|
|
101
|
+
<TableBodyCell tdClass="p-2" data-testid="vaultBalanceChangesTableBalance">
|
|
102
|
+
<div class="flex flex-col overflow-hidden">
|
|
103
|
+
<span class="truncate font-medium">{item.token.symbol}</span>
|
|
104
|
+
<span
|
|
105
|
+
id={`balance-${item.transaction.id}`}
|
|
106
|
+
class="truncate text-sm text-gray-500 dark:text-gray-400">{item.formattedNewBalance}</span
|
|
107
|
+
>
|
|
108
|
+
<Tooltip triggeredBy={`#balance-${item.transaction.id}`}>
|
|
109
|
+
{`${item.formattedNewBalance} ${item.token.symbol}`}
|
|
110
|
+
</Tooltip>
|
|
111
|
+
</div>
|
|
72
112
|
</TableBodyCell>
|
|
73
113
|
</svelte:fragment>
|
|
74
114
|
</AppTable>
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { RaindexVault } from '@rainlanguage/raindex';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
vault: RaindexVault;
|
|
6
6
|
};
|
|
7
|
-
events
|
|
7
|
+
events: {
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
9
9
|
};
|
|
10
|
-
slots
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export type
|
|
15
|
-
export
|
|
10
|
+
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type VaultBalanceChangesTableProps = typeof __propDef.props;
|
|
15
|
+
export type VaultBalanceChangesTableEvents = typeof __propDef.events;
|
|
16
|
+
export type VaultBalanceChangesTableSlots = typeof __propDef.slots;
|
|
17
|
+
export default class VaultBalanceChangesTable extends SvelteComponent<VaultBalanceChangesTableProps, VaultBalanceChangesTableEvents, VaultBalanceChangesTableSlots> {
|
|
16
18
|
}
|
|
17
19
|
export {};
|