@rainlanguage/ui-components 0.0.1-alpha.237 → 0.0.1-alpha.239
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 +18 -20
- 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 +7 -3
- package/dist/__mocks__/MockComponent.svelte.d.ts +1 -0
- 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 +4 -4
- package/dist/__mocks__/stores.js +40 -40
- package/dist/app.css +3 -3
- package/dist/components/ButtonDarkMode.svelte +7 -1
- package/dist/components/ButtonScrub.svelte +22 -0
- package/dist/components/ButtonScrub.svelte.d.ts +25 -0
- package/dist/components/ButtonVaultLink.svelte +3 -2
- package/dist/components/ButtonVaultLink.svelte.d.ts +2 -2
- package/dist/components/CodeMirrorRainlang.svelte +19 -2
- package/dist/components/CodeMirrorRainlang.svelte.d.ts +2 -1
- package/dist/components/Hash.svelte +3 -2
- package/dist/components/{ListViewOrderbookFilters.svelte → ListViewRaindexFilters.svelte} +7 -7
- package/dist/components/{ListViewOrderbookFilters.svelte.d.ts → ListViewRaindexFilters.svelte.d.ts} +7 -7
- package/dist/components/LocalDbStatusBadge.svelte.d.ts +1 -1
- package/dist/components/LocalDbStatusCard.svelte +7 -4
- package/dist/components/LocalDbStatusCard.svelte.d.ts +2 -2
- package/dist/components/LocalDbStatusModal.svelte +16 -14
- package/dist/components/LocalDbStatusModal.svelte.d.ts +2 -2
- package/dist/components/OrderOrVaultHash.svelte +2 -2
- package/dist/components/OrderOrVaultHash.svelte.d.ts +2 -2
- package/dist/components/Sensitive.svelte +16 -0
- package/dist/components/Sensitive.svelte.d.ts +28 -0
- package/dist/components/TanstackAppTable.svelte +146 -87
- package/dist/components/TanstackAppTable.svelte.d.ts +1 -1
- package/dist/components/VaultBalanceChangeTypeFilter.svelte +1 -1
- package/dist/components/VaultBalanceChangeTypeFilter.svelte.d.ts +1 -1
- package/dist/components/VaultCard.svelte +1 -1
- package/dist/components/VaultCard.svelte.d.ts +1 -1
- package/dist/components/charts/OrderTradesChart.svelte +116 -97
- package/dist/components/charts/OrderTradesChart.svelte.d.ts +2 -2
- package/dist/components/charts/transformAndSortData.d.ts +1 -1
- package/dist/components/charts/transformAndSortData.js +19 -19
- package/dist/components/deployment/DeploymentSteps.svelte +5 -2
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +1 -1
- package/dist/components/deployment/DeploymentsSection.svelte.d.ts +1 -1
- package/dist/components/deployment/DepositInput.svelte +1 -1
- package/dist/components/deployment/DepositInput.svelte.d.ts +1 -1
- package/dist/components/deployment/FieldDefinitionInput.svelte +1 -1
- package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +1 -1
- package/dist/components/deployment/OrderPage.svelte.d.ts +1 -1
- package/dist/components/deployment/SelectToken.svelte.d.ts +1 -1
- package/dist/components/deployment/TokenIOInput.svelte +1 -1
- package/dist/components/deployment/TokenIOInput.svelte.d.ts +1 -1
- package/dist/components/deployment/TokenSelectionModal.svelte.d.ts +1 -1
- package/dist/components/detail/OrderDetail.svelte +12 -6
- package/dist/components/detail/OrderDetail.svelte.d.ts +2 -2
- package/dist/components/detail/TanstackOrderQuote.svelte +22 -0
- package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +1 -1
- package/dist/components/detail/VaultDetail.svelte +12 -10
- package/dist/components/detail/VaultDetail.svelte.d.ts +2 -2
- package/dist/components/dropdown/{DropdownOrderbooksFilter.svelte → DropdownRaindexesFilter.svelte} +54 -54
- package/dist/components/dropdown/DropdownRaindexesFilter.svelte.d.ts +25 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte.d.ts +1 -1
- package/dist/components/icon/Refresh.svelte +2 -1
- package/dist/components/icon/Refresh.svelte.d.ts +1 -0
- package/dist/components/input/InputTokenAmount.svelte +16 -1
- package/dist/components/input/InputTokenAmount.svelte.d.ts +1 -1
- package/dist/components/tables/OrderTradesListTable.svelte +113 -98
- package/dist/components/tables/OrderTradesListTable.svelte.d.ts +1 -1
- package/dist/components/tables/OrderVaultsVolTable.svelte +1 -1
- package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +1 -1
- package/dist/components/tables/OrdersListTable.svelte +19 -17
- package/dist/components/tables/OrdersListTable.svelte.d.ts +1 -1
- package/dist/components/tables/VaultBalanceChangesTable.svelte +1 -1
- package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +1 -1
- package/dist/components/tables/VaultsListTable.svelte +24 -21
- package/dist/components/tables/VaultsListTable.svelte.d.ts +2 -2
- package/dist/components/transactions/FixedBottomTransaction.svelte +1 -0
- package/dist/components/transactions/getStatusEmoji.d.ts +1 -1
- package/dist/components/transactions/getStatusEmoji.js +13 -13
- package/dist/consts.js +1 -1
- package/dist/errors/DeploymentStepsError.js +3 -3
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/hooks/useLocalDb.d.ts +1 -1
- package/dist/hooks/useLocalDb.js +3 -3
- package/dist/hooks/useRaindexClient.d.ts +1 -1
- package/dist/hooks/useRaindexClient.js +4 -4
- package/dist/hooks/useRaindexOrderBuilder.d.ts +1 -1
- package/dist/hooks/useRaindexOrderBuilder.js +4 -4
- package/dist/index.d.ts +122 -114
- package/dist/index.js +115 -109
- package/dist/models/Transaction.d.ts +4 -4
- package/dist/models/Transaction.js +9 -9
- package/dist/providers/RaindexClientProvider.svelte +1 -1
- package/dist/providers/RaindexClientProvider.svelte.d.ts +1 -1
- package/dist/providers/RaindexOrderBuilderProvider.svelte +1 -1
- package/dist/providers/RaindexOrderBuilderProvider.svelte.d.ts +1 -1
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte.d.ts +1 -1
- package/dist/providers/dotrainRegistry/context.d.ts +2 -2
- package/dist/providers/dotrainRegistry/context.js +13 -10
- package/dist/providers/dotrainRegistry/useDotrainRegistry.d.ts +1 -1
- package/dist/providers/dotrainRegistry/useDotrainRegistry.js +8 -8
- package/dist/providers/registry/RegistryManager.js +8 -7
- package/dist/providers/registry/context.d.ts +1 -1
- package/dist/providers/registry/context.js +9 -9
- package/dist/providers/registry/useRegistry.d.ts +1 -1
- package/dist/providers/registry/useRegistry.js +5 -5
- package/dist/providers/toasts/context.d.ts +2 -2
- package/dist/providers/toasts/context.js +4 -4
- package/dist/providers/toasts/useToasts.d.ts +1 -1
- package/dist/providers/toasts/useToasts.js +4 -4
- package/dist/providers/transactions/TransactionManager.d.ts +14 -15
- package/dist/providers/transactions/TransactionManager.js +107 -107
- package/dist/providers/transactions/context.d.ts +1 -1
- package/dist/providers/transactions/context.js +4 -4
- package/dist/providers/transactions/useTransactions.js +2 -2
- package/dist/providers/wallet/context.d.ts +1 -1
- package/dist/providers/wallet/context.js +11 -11
- package/dist/providers/wallet/useAccount.js +27 -27
- package/dist/queries/keys.js +10 -10
- package/dist/queries/queryClient.d.ts +1 -1
- package/dist/queries/queryClient.js +8 -8
- package/dist/services/awaitTransactionIndexing.d.ts +8 -8
- package/dist/services/awaitTransactionIndexing.js +10 -8
- package/dist/services/getExplorerLink.js +2 -2
- package/dist/services/handleShareChoices.d.ts +1 -1
- package/dist/services/handleShareChoices.js +4 -4
- package/dist/services/historicalOrderCharts.d.ts +2 -2
- package/dist/services/historicalOrderCharts.js +260 -201
- package/dist/services/index.d.ts +5 -3
- package/dist/services/index.js +3 -2
- package/dist/services/loadRegistryUrl.d.ts +1 -1
- package/dist/services/loadRegistryUrl.js +5 -5
- package/dist/services/pairTradesChartData.d.ts +2 -2
- package/dist/services/pairTradesChartData.js +28 -24
- package/dist/services/registry.d.ts +1 -1
- package/dist/services/registry.js +10 -10
- package/dist/services/time.d.ts +1 -1
- package/dist/services/time.js +35 -35
- package/dist/services/validateAmount.d.ts +30 -0
- package/dist/services/validateAmount.js +53 -0
- package/dist/storesGeneric/cachedWritableStore.d.ts +2 -2
- package/dist/storesGeneric/cachedWritableStore.js +3 -3
- 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 +2 -2
- package/dist/types/appStores.d.ts +3 -3
- package/dist/types/modal.d.ts +3 -3
- package/dist/types/order.d.ts +1 -1
- package/dist/types/toast.d.ts +2 -2
- package/dist/types/tokenBalance.d.ts +1 -1
- package/dist/types/transaction.d.ts +4 -4
- package/dist/utils/breadcrumbs.js +2 -2
- package/dist/utils/codeMirrorThemes.js +80 -74
- package/dist/utils/configHelpers.d.ts +1 -1
- package/dist/utils/configHelpers.js +6 -6
- package/dist/utils/constructHashLink.d.ts +3 -3
- package/dist/utils/constructHashLink.js +39 -37
- package/dist/utils/getNetworkName.js +5 -5
- 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.js +5 -3
- package/dist/utils/stripTrailingWhitespace.d.ts +16 -0
- package/dist/utils/stripTrailingWhitespace.js +22 -0
- package/dist/utils/tokens.d.ts +1 -1
- package/dist/utils/tokens.js +1 -1
- package/dist/utils/vaultBalanceChangeLabels.d.ts +1 -1
- package/dist/utils/vaultBalanceChangeLabels.js +11 -11
- package/package.json +89 -89
- package/dist/components/dropdown/DropdownOrderbooksFilter.svelte.d.ts +0 -25
|
@@ -5,7 +5,7 @@ import { isEmpty } from "lodash";
|
|
|
5
5
|
import { Alert } from "flowbite-svelte";
|
|
6
6
|
import CheckboxActiveOrders from "./checkbox/CheckboxActiveOrders.svelte";
|
|
7
7
|
import DropdownTokensFilter from "./dropdown/DropdownTokensFilter.svelte";
|
|
8
|
-
import
|
|
8
|
+
import DropdownRaindexesFilter from "./dropdown/DropdownRaindexesFilter.svelte";
|
|
9
9
|
import InputOrderHash from "./input/InputOrderHash.svelte";
|
|
10
10
|
import InputOwnerFilter from "./input/InputOwnerFilter.svelte";
|
|
11
11
|
import CheckboxZeroBalanceVault from "./CheckboxZeroBalanceVault.svelte";
|
|
@@ -18,8 +18,8 @@ export let orderHash;
|
|
|
18
18
|
export let activeTokens;
|
|
19
19
|
export let selectedTokens;
|
|
20
20
|
export let tokensQuery;
|
|
21
|
-
export let
|
|
22
|
-
export let
|
|
21
|
+
export let activeRaindexAddresses;
|
|
22
|
+
export let selectedRaindexAddresses;
|
|
23
23
|
export let ownerFilter;
|
|
24
24
|
$: isVaultsPage = $page.url.pathname === "/vaults";
|
|
25
25
|
$: isOrdersPage = $page.url.pathname === "/orders";
|
|
@@ -53,11 +53,11 @@ $: networks = raindexClient.getAllNetworks();
|
|
|
53
53
|
{/if}
|
|
54
54
|
<InputOwnerFilter {ownerFilter} />
|
|
55
55
|
<DropdownTokensFilter {tokensQuery} {activeTokens} {selectedTokens} label="Tokens" />
|
|
56
|
-
<
|
|
57
|
-
{
|
|
58
|
-
{
|
|
56
|
+
<DropdownRaindexesFilter
|
|
57
|
+
{activeRaindexAddresses}
|
|
58
|
+
{selectedRaindexAddresses}
|
|
59
59
|
selectedChainIds={$selectedChainIds}
|
|
60
|
-
label="
|
|
60
|
+
label="Raindexes"
|
|
61
61
|
/>
|
|
62
62
|
<DropdownActiveNetworks {selectedChainIds} />
|
|
63
63
|
{/if}
|
package/dist/components/{ListViewOrderbookFilters.svelte.d.ts → ListViewRaindexFilters.svelte.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
import type { QueryObserverResult } from '@tanstack/svelte-query';
|
|
3
3
|
import type { Readable } from 'svelte/store';
|
|
4
|
-
import type { Address, RaindexVaultToken } from '@rainlanguage/
|
|
4
|
+
import type { Address, RaindexVaultToken } from '@rainlanguage/raindex';
|
|
5
5
|
import type { AppStoresInterface } from '../types/appStores';
|
|
6
6
|
declare const __propDef: {
|
|
7
7
|
props: {
|
|
@@ -13,8 +13,8 @@ declare const __propDef: {
|
|
|
13
13
|
activeTokens: AppStoresInterface["activeTokens"];
|
|
14
14
|
selectedTokens: Address[];
|
|
15
15
|
tokensQuery: Readable<QueryObserverResult<RaindexVaultToken[], Error>>;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
activeRaindexAddresses: AppStoresInterface["activeRaindexAddresses"];
|
|
17
|
+
selectedRaindexAddresses: Address[];
|
|
18
18
|
ownerFilter: AppStoresInterface["ownerFilter"];
|
|
19
19
|
};
|
|
20
20
|
events: {
|
|
@@ -24,9 +24,9 @@ declare const __propDef: {
|
|
|
24
24
|
exports?: {} | undefined;
|
|
25
25
|
bindings?: string | undefined;
|
|
26
26
|
};
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
30
|
-
export default class
|
|
27
|
+
export type ListViewRaindexFiltersProps = typeof __propDef.props;
|
|
28
|
+
export type ListViewRaindexFiltersEvents = typeof __propDef.events;
|
|
29
|
+
export type ListViewRaindexFiltersSlots = typeof __propDef.slots;
|
|
30
|
+
export default class ListViewRaindexFilters extends SvelteComponent<ListViewRaindexFiltersProps, ListViewRaindexFiltersEvents, ListViewRaindexFiltersSlots> {
|
|
31
31
|
}
|
|
32
32
|
export {};
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<script>import LocalDbStatusBadge from "./LocalDbStatusBadge.svelte";
|
|
2
2
|
import LocalDbStatusModal from "./LocalDbStatusModal.svelte";
|
|
3
|
+
import { aggregateLocalDbStatus } from "../utils/localDbStatus";
|
|
3
4
|
import { ChevronRightOutline } from "flowbite-svelte-icons";
|
|
4
5
|
export let networkStatuses = /* @__PURE__ */ new Map();
|
|
5
|
-
export let
|
|
6
|
+
export let raindexStatuses = /* @__PURE__ */ new Map();
|
|
6
7
|
let modalOpen = false;
|
|
7
8
|
$: networkList = Array.from(networkStatuses.values());
|
|
8
9
|
$: hasNetworks = networkList.length > 0;
|
|
9
|
-
$:
|
|
10
|
-
|
|
10
|
+
$: displayStatus = aggregateLocalDbStatus([
|
|
11
|
+
...networkList,
|
|
12
|
+
...Array.from(raindexStatuses.values())
|
|
13
|
+
]).status;
|
|
11
14
|
function openModal() {
|
|
12
15
|
modalOpen = true;
|
|
13
16
|
}
|
|
@@ -37,4 +40,4 @@ function openModal() {
|
|
|
37
40
|
</button>
|
|
38
41
|
</div>
|
|
39
42
|
|
|
40
|
-
<LocalDbStatusModal bind:open={modalOpen} {networkStatuses} {
|
|
43
|
+
<LocalDbStatusModal bind:open={modalOpen} {networkStatuses} {raindexStatuses} />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { NetworkSyncStatus,
|
|
2
|
+
import type { NetworkSyncStatus, RaindexSyncStatus } from '@rainlanguage/raindex';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
networkStatuses?: Map<number, NetworkSyncStatus>;
|
|
6
|
-
|
|
6
|
+
raindexStatuses?: Map<string, RaindexSyncStatus>;
|
|
7
7
|
};
|
|
8
8
|
events: {
|
|
9
9
|
[evt: string]: CustomEvent<any>;
|
|
@@ -3,19 +3,21 @@ import LocalDbStatusBadge from "./LocalDbStatusBadge.svelte";
|
|
|
3
3
|
import { getNetworkName } from "../utils/getNetworkName";
|
|
4
4
|
export let open = false;
|
|
5
5
|
export let networkStatuses = /* @__PURE__ */ new Map();
|
|
6
|
-
export let
|
|
6
|
+
export let raindexStatuses = /* @__PURE__ */ new Map();
|
|
7
7
|
$: networkList = Array.from(networkStatuses.values());
|
|
8
|
-
$:
|
|
9
|
-
$: networkGroups = buildNetworkGroups(networkList,
|
|
10
|
-
function buildNetworkGroups(networks,
|
|
8
|
+
$: raindexList = Array.from(raindexStatuses.values());
|
|
9
|
+
$: networkGroups = buildNetworkGroups(networkList, raindexList);
|
|
10
|
+
function buildNetworkGroups(networks, raindexes) {
|
|
11
11
|
const groups = [];
|
|
12
12
|
for (const network of networks) {
|
|
13
|
-
const
|
|
13
|
+
const networkRaindexes = raindexes.filter(
|
|
14
|
+
(raindex) => raindex.raindexId.chainId === network.chainId
|
|
15
|
+
);
|
|
14
16
|
groups.push({
|
|
15
17
|
chainId: network.chainId,
|
|
16
18
|
networkName: getNetworkName(network.chainId) ?? `Chain ${network.chainId}`,
|
|
17
19
|
status: network,
|
|
18
|
-
|
|
20
|
+
raindexes: networkRaindexes
|
|
19
21
|
});
|
|
20
22
|
}
|
|
21
23
|
return groups;
|
|
@@ -59,26 +61,26 @@ function buildNetworkGroups(networks, orderbooks) {
|
|
|
59
61
|
<LocalDbStatusBadge status={group.status.status} />
|
|
60
62
|
</div>
|
|
61
63
|
|
|
62
|
-
{#if group.
|
|
64
|
+
{#if group.raindexes.length > 0}
|
|
63
65
|
<ul class="divide-y divide-gray-100 dark:divide-gray-800">
|
|
64
|
-
{#each group.
|
|
66
|
+
{#each group.raindexes as raindexStatus (raindexStatus.raindexId.raindexAddress)}
|
|
65
67
|
<li class="px-4 py-3">
|
|
66
68
|
<div class="flex items-start justify-between gap-4">
|
|
67
69
|
<div class="min-w-0 flex-1">
|
|
68
70
|
<span
|
|
69
71
|
class="font-mono text-sm text-gray-700 dark:text-gray-300"
|
|
70
|
-
title={
|
|
72
|
+
title={raindexStatus.raindexId.raindexAddress}
|
|
71
73
|
>
|
|
72
|
-
{
|
|
74
|
+
{raindexStatus.raindexId.raindexAddress}
|
|
73
75
|
</span>
|
|
74
|
-
{#if
|
|
76
|
+
{#if raindexStatus.status === 'syncing' && raindexStatus.phaseMessage && raindexStatus.schedulerState !== 'notLeader'}
|
|
75
77
|
<div class="mt-2 text-sm text-sky-600 dark:text-sky-400">
|
|
76
|
-
{
|
|
78
|
+
{raindexStatus.phaseMessage}
|
|
77
79
|
</div>
|
|
78
80
|
{/if}
|
|
79
|
-
{#if
|
|
81
|
+
{#if raindexStatus.status === 'failure' && raindexStatus.error}
|
|
80
82
|
<div class="mt-2 text-sm text-red-600 dark:text-red-400">
|
|
81
|
-
{
|
|
83
|
+
{raindexStatus.error}
|
|
82
84
|
</div>
|
|
83
85
|
{/if}
|
|
84
86
|
</div>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { NetworkSyncStatus,
|
|
2
|
+
import type { NetworkSyncStatus, RaindexSyncStatus } from '@rainlanguage/raindex';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
open?: boolean;
|
|
6
6
|
networkStatuses?: Map<number, NetworkSyncStatus>;
|
|
7
|
-
|
|
7
|
+
raindexStatuses?: Map<string, RaindexSyncStatus>;
|
|
8
8
|
};
|
|
9
9
|
events: {
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
export let orderOrVault;
|
|
9
9
|
export let type;
|
|
10
10
|
export let chainId;
|
|
11
|
-
export let
|
|
11
|
+
export let raindexAddress;
|
|
12
12
|
$: hash = extractHash(orderOrVault);
|
|
13
13
|
$: isActive = isOrderOrVaultActive(orderOrVault);
|
|
14
|
-
$: linkPath = constructHashLink(orderOrVault, type, chainId,
|
|
14
|
+
$: linkPath = constructHashLink(orderOrVault, type, chainId, raindexAddress);
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<a data-testid="order-or-vault-hash" href={linkPath}>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Address, RaindexOrder, RaindexOrderAsIO, RaindexVault } from '@rainlanguage/
|
|
2
|
+
import type { Address, RaindexOrder, RaindexOrderAsIO, RaindexVault } from '@rainlanguage/raindex';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
orderOrVault: RaindexVault | RaindexOrder | RaindexOrderAsIO;
|
|
6
6
|
type: "orders" | "vaults";
|
|
7
7
|
chainId: number;
|
|
8
|
-
|
|
8
|
+
raindexAddress: Address;
|
|
9
9
|
};
|
|
10
10
|
events: {
|
|
11
11
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script>import { scrub as scrubStore } from "../storesGeneric/scrub";
|
|
2
|
+
export let scrub = scrubStore;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<span class="relative inline-block align-bottom" data-testid="sensitive">
|
|
6
|
+
<span class:invisible={$scrub} data-testid="sensitive-content">
|
|
7
|
+
<slot />
|
|
8
|
+
</span>
|
|
9
|
+
{#if $scrub}
|
|
10
|
+
<span
|
|
11
|
+
class="absolute inset-0 rounded bg-gray-400 dark:bg-gray-600"
|
|
12
|
+
data-testid="sensitive-mask"
|
|
13
|
+
aria-hidden="true"
|
|
14
|
+
></span>
|
|
15
|
+
{/if}
|
|
16
|
+
</span>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Writable } from 'svelte/store';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
/**
|
|
6
|
+
* Wrap any content that may reveal an address or transaction hash. When the
|
|
7
|
+
* global `scrub` toggle is on, an opaque grey box is laid over the slotted
|
|
8
|
+
* content so it can't be read in a screenshot. Purely presentational - the
|
|
9
|
+
* underlying value is untouched.
|
|
10
|
+
*
|
|
11
|
+
* The store is injectable for testing; it defaults to the global scrub store.
|
|
12
|
+
*/ scrub?: Writable<boolean>;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {
|
|
18
|
+
default: {};
|
|
19
|
+
};
|
|
20
|
+
exports?: {} | undefined;
|
|
21
|
+
bindings?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
export type SensitiveProps = typeof __propDef.props;
|
|
24
|
+
export type SensitiveEvents = typeof __propDef.events;
|
|
25
|
+
export type SensitiveSlots = typeof __propDef.slots;
|
|
26
|
+
export default class Sensitive extends SvelteComponent<SensitiveProps, SensitiveEvents, SensitiveSlots> {
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
<script generics="DataItem, InputData = DataItem[]">import { invalidateTanstackQueries } from "../queries/queryClient";
|
|
2
2
|
import Refresh from "./icon/Refresh.svelte";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
Table,
|
|
6
|
+
TableBody,
|
|
7
|
+
TableBodyRow,
|
|
8
|
+
TableHead
|
|
9
|
+
} from "flowbite-svelte";
|
|
10
|
+
import {
|
|
11
|
+
afterUpdate,
|
|
12
|
+
createEventDispatcher,
|
|
13
|
+
onDestroy,
|
|
14
|
+
onMount
|
|
15
|
+
} from "svelte";
|
|
5
16
|
import { useQueryClient } from "@tanstack/svelte-query";
|
|
6
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
createWindowVirtualizer
|
|
19
|
+
} from "@tanstack/svelte-virtual";
|
|
7
20
|
const queryClient = useQueryClient();
|
|
8
21
|
const dispatch = createEventDispatcher();
|
|
9
22
|
export let queryKey;
|
|
@@ -37,6 +50,7 @@ $: {
|
|
|
37
50
|
$: flattenedRows = transformedPages.flat();
|
|
38
51
|
$: totalRows = flattenedRows.length;
|
|
39
52
|
$: hasData = totalRows > 0;
|
|
53
|
+
$: isInitialLoading = totalRows === 0 && ($query.isLoading || $query.isFetching);
|
|
40
54
|
const hasWindow = typeof window !== "undefined";
|
|
41
55
|
let tableContainerElement = null;
|
|
42
56
|
let tableOffsetTop = 0;
|
|
@@ -118,7 +132,9 @@ afterUpdate(() => {
|
|
|
118
132
|
return;
|
|
119
133
|
}
|
|
120
134
|
const rows = Array.from(
|
|
121
|
-
tableContainerElement.querySelectorAll(
|
|
135
|
+
tableContainerElement.querySelectorAll(
|
|
136
|
+
'tbody tr[data-virtual-row="true"]'
|
|
137
|
+
)
|
|
122
138
|
);
|
|
123
139
|
if (!rows.length) {
|
|
124
140
|
return;
|
|
@@ -136,89 +152,132 @@ afterUpdate(() => {
|
|
|
136
152
|
</script>
|
|
137
153
|
|
|
138
154
|
<div data-testid="title" class="flex h-16 w-full items-center justify-end">
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
155
|
+
<slot name="info" />
|
|
156
|
+
<slot name="timeFilter" />
|
|
157
|
+
<slot name="title" />
|
|
158
|
+
<Refresh
|
|
159
|
+
class="ml-2 h-8 w-5 cursor-pointer text-gray-400 dark:text-gray-400"
|
|
160
|
+
data-testid="refreshButton"
|
|
161
|
+
title="Refresh"
|
|
162
|
+
ariaLabel="Refresh"
|
|
163
|
+
spin={$query.isLoading || $query.isFetching}
|
|
164
|
+
on:click={async () => {
|
|
165
|
+
if (queryKey) {
|
|
166
|
+
invalidateTanstackQueries(queryClient, [queryKey]);
|
|
167
|
+
}
|
|
168
|
+
}}
|
|
169
|
+
/>
|
|
152
170
|
</div>
|
|
153
|
-
{#if
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
171
|
+
{#if isInitialLoading}
|
|
172
|
+
<div
|
|
173
|
+
data-testid="tableLoadingSkeleton"
|
|
174
|
+
class="animate-pulse overflow-hidden rounded-lg border dark:border-gray-700"
|
|
175
|
+
>
|
|
176
|
+
<div
|
|
177
|
+
class="grid grid-cols-5 gap-4 border-b bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800"
|
|
178
|
+
>
|
|
179
|
+
{#each [0, 1, 2, 3, 4] as columnIndex (columnIndex)}
|
|
180
|
+
<div class="h-3 rounded bg-gray-200 dark:bg-gray-700" />
|
|
181
|
+
{/each}
|
|
182
|
+
</div>
|
|
183
|
+
{#each [0, 1, 2, 3, 4, 5, 6, 7] as rowIndex (rowIndex)}
|
|
184
|
+
<div
|
|
185
|
+
class="grid grid-cols-5 gap-4 border-b p-4 last:border-b-0 dark:border-gray-700"
|
|
186
|
+
>
|
|
187
|
+
<div class="h-4 rounded bg-gray-200 dark:bg-gray-700" />
|
|
188
|
+
<div class="h-4 rounded bg-gray-200 dark:bg-gray-700" />
|
|
189
|
+
<div class="h-4 rounded bg-gray-200 dark:bg-gray-700" />
|
|
190
|
+
<div class="h-4 rounded bg-gray-200 dark:bg-gray-700" />
|
|
191
|
+
<div class="h-4 rounded bg-gray-200 dark:bg-gray-700" />
|
|
192
|
+
</div>
|
|
193
|
+
{/each}
|
|
194
|
+
</div>
|
|
195
|
+
{:else if totalRows === 0}
|
|
196
|
+
<div
|
|
197
|
+
data-testid="emptyMessage"
|
|
198
|
+
class="text-center text-gray-900 dark:text-white"
|
|
199
|
+
>
|
|
200
|
+
{emptyMessage}
|
|
201
|
+
</div>
|
|
157
202
|
{:else if hasData}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
203
|
+
<div
|
|
204
|
+
class="cursor-pointer overflow-x-auto rounded-lg border dark:border-none"
|
|
205
|
+
data-testid="tanstackTableContainer"
|
|
206
|
+
bind:this={tableContainerElement}
|
|
207
|
+
>
|
|
208
|
+
<Table
|
|
209
|
+
divClass="min-w-full"
|
|
210
|
+
class="w-full table-fixed"
|
|
211
|
+
hoverable={rowHoverable}
|
|
212
|
+
>
|
|
213
|
+
<TableHead data-testid="head">
|
|
214
|
+
<slot name="head" />
|
|
215
|
+
</TableHead>
|
|
216
|
+
<TableBody>
|
|
217
|
+
{#if virtualizationActive && topPadding > 0}
|
|
218
|
+
<tr aria-hidden="true">
|
|
219
|
+
<td
|
|
220
|
+
colspan="1000"
|
|
221
|
+
class="border-0 p-0"
|
|
222
|
+
style={`height:${topPadding}px;`}
|
|
223
|
+
/>
|
|
224
|
+
</tr>
|
|
225
|
+
{/if}
|
|
226
|
+
{#if virtualizationActive}
|
|
227
|
+
{#each virtualItems as virtualItem (virtualItem.key)}
|
|
228
|
+
<TableBodyRow
|
|
229
|
+
class="whitespace-nowrap"
|
|
230
|
+
data-testid="bodyRow"
|
|
231
|
+
data-virtual-row="true"
|
|
232
|
+
on:click={() => {
|
|
233
|
+
dispatch("clickRow", {
|
|
234
|
+
item: flattenedRows[virtualItem.index],
|
|
235
|
+
});
|
|
236
|
+
}}
|
|
237
|
+
>
|
|
238
|
+
<slot name="bodyRow" item={flattenedRows[virtualItem.index]} />
|
|
239
|
+
</TableBodyRow>
|
|
240
|
+
{/each}
|
|
241
|
+
{:else}
|
|
242
|
+
{#each transformedPages as page}
|
|
243
|
+
{#each page as item}
|
|
244
|
+
<TableBodyRow
|
|
245
|
+
class="whitespace-nowrap"
|
|
246
|
+
data-testid="bodyRow"
|
|
247
|
+
on:click={() => {
|
|
248
|
+
dispatch("clickRow", { item });
|
|
249
|
+
}}
|
|
250
|
+
>
|
|
251
|
+
<slot name="bodyRow" {item} />
|
|
252
|
+
</TableBodyRow>
|
|
253
|
+
{/each}
|
|
254
|
+
{/each}
|
|
255
|
+
{/if}
|
|
256
|
+
{#if virtualizationActive && bottomPadding > 0}
|
|
257
|
+
<tr aria-hidden="true">
|
|
258
|
+
<td
|
|
259
|
+
colspan="1000"
|
|
260
|
+
class="border-0 p-0"
|
|
261
|
+
style={`height:${bottomPadding}px;`}
|
|
262
|
+
/>
|
|
263
|
+
</tr>
|
|
264
|
+
{/if}
|
|
265
|
+
</TableBody>
|
|
266
|
+
</Table>
|
|
267
|
+
</div>
|
|
268
|
+
<div class="mt-2 flex justify-center">
|
|
269
|
+
<Button
|
|
270
|
+
data-testid="loadMoreButton"
|
|
271
|
+
size="xs"
|
|
272
|
+
color="dark"
|
|
273
|
+
on:click={() => $query.fetchNextPage()}
|
|
274
|
+
disabled={!$query.hasNextPage || $query.isFetchingNextPage}
|
|
275
|
+
>
|
|
276
|
+
{#if $query.isFetchingNextPage}
|
|
277
|
+
Loading more...
|
|
278
|
+
{:else if $query.hasNextPage}
|
|
279
|
+
Load More
|
|
280
|
+
{:else}Nothing more to load{/if}
|
|
281
|
+
</Button>
|
|
282
|
+
</div>
|
|
224
283
|
{/if}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { CreateInfiniteQueryResult, InfiniteData } from
|
|
2
|
+
import type { CreateInfiniteQueryResult, InfiniteData } from "@tanstack/svelte-query";
|
|
3
3
|
declare class __sveltets_Render<DataItem, InputData = DataItem[]> {
|
|
4
4
|
props(): {
|
|
5
5
|
queryKey: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import {} from "@rainlanguage/
|
|
1
|
+
<script>import {} from "@rainlanguage/raindex";
|
|
2
2
|
import DropdownCheckbox from "./dropdown/DropdownCheckbox.svelte";
|
|
3
3
|
import { VAULT_BALANCE_CHANGE_FILTER_LABELS } from "../utils/vaultBalanceChangeLabels";
|
|
4
4
|
export let value = void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { type VaultBalanceChangeFilter } from '@rainlanguage/
|
|
2
|
+
import { type VaultBalanceChangeFilter } from '@rainlanguage/raindex';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
value?: VaultBalanceChangeFilter[] | undefined;
|