@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
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { goto } from "$app/navigation";
|
|
3
3
|
import { DotsVerticalOutline } from "flowbite-svelte-icons";
|
|
4
4
|
import { createInfiniteQuery, createQuery } from "@tanstack/svelte-query";
|
|
5
|
-
import { RaindexOrder } from "@rainlanguage/
|
|
5
|
+
import { RaindexOrder } from "@rainlanguage/raindex";
|
|
6
6
|
import TanstackAppTable from "../TanstackAppTable.svelte";
|
|
7
7
|
import { formatTimestampSecondsAsLocal } from "../../services/time";
|
|
8
|
-
import
|
|
8
|
+
import ListViewRaindexFilters from "../ListViewRaindexFilters.svelte";
|
|
9
9
|
import Hash, { HashType } from "../Hash.svelte";
|
|
10
10
|
import VaultCard from "../VaultCard.svelte";
|
|
11
11
|
import { DEFAULT_PAGE_SIZE, DEFAULT_REFRESH_INTERVAL } from "../../queries/constants";
|
|
@@ -30,7 +30,7 @@ export let orderHash;
|
|
|
30
30
|
export let hideZeroBalanceVaults;
|
|
31
31
|
export let hideInactiveOrdersVaults;
|
|
32
32
|
export let activeTokens;
|
|
33
|
-
export let
|
|
33
|
+
export let activeRaindexAddresses;
|
|
34
34
|
export let ownerFilter;
|
|
35
35
|
const { matchesAccount, account } = useAccount();
|
|
36
36
|
const raindexClient = useRaindexClient();
|
|
@@ -48,18 +48,18 @@ $: tokensQuery = createQuery({
|
|
|
48
48
|
$: selectedTokens = $activeTokens?.filter(
|
|
49
49
|
(address) => !$tokensQuery.data || $tokensQuery.data.some((t) => t.address === address)
|
|
50
50
|
) ?? [];
|
|
51
|
-
$:
|
|
52
|
-
$:
|
|
51
|
+
$: raindexesMap = raindexClient.getAllRaindexes()?.value ?? /* @__PURE__ */ new Map();
|
|
52
|
+
$: availableRaindexAddresses = (() => {
|
|
53
53
|
const addrs = [];
|
|
54
|
-
|
|
54
|
+
raindexesMap.forEach((cfg) => {
|
|
55
55
|
if ($selectedChainIds.length === 0 || $selectedChainIds.includes(cfg.network.chainId)) {
|
|
56
56
|
addrs.push(cfg.address.toLowerCase());
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
return addrs;
|
|
60
60
|
})();
|
|
61
|
-
$:
|
|
62
|
-
(address) =>
|
|
61
|
+
$: selectedRaindexAddresses = $activeRaindexAddresses?.filter(
|
|
62
|
+
(address) => availableRaindexAddresses.includes(address.toLowerCase())
|
|
63
63
|
) ?? [];
|
|
64
64
|
$: query = createInfiniteQuery({
|
|
65
65
|
queryKey: [
|
|
@@ -69,7 +69,7 @@ $: query = createInfiniteQuery({
|
|
|
69
69
|
$showInactiveOrders,
|
|
70
70
|
$orderHash,
|
|
71
71
|
selectedTokens,
|
|
72
|
-
|
|
72
|
+
selectedRaindexAddresses
|
|
73
73
|
],
|
|
74
74
|
queryFn: async ({ pageParam }) => {
|
|
75
75
|
const result = await raindexClient.getOrders(
|
|
@@ -79,7 +79,7 @@ $: query = createInfiniteQuery({
|
|
|
79
79
|
active: $showInactiveOrders ? void 0 : true,
|
|
80
80
|
orderHash: $orderHash || void 0,
|
|
81
81
|
tokens: selectedTokens.length > 0 ? { inputs: selectedTokens, outputs: selectedTokens } : void 0,
|
|
82
|
-
|
|
82
|
+
raindexAddresses: selectedRaindexAddresses.length > 0 ? selectedRaindexAddresses : void 0
|
|
83
83
|
},
|
|
84
84
|
pageParam + 1
|
|
85
85
|
);
|
|
@@ -96,7 +96,7 @@ $: query = createInfiniteQuery({
|
|
|
96
96
|
const AppTable = TanstackAppTable;
|
|
97
97
|
</script>
|
|
98
98
|
|
|
99
|
-
<
|
|
99
|
+
<ListViewRaindexFilters
|
|
100
100
|
{selectedChainIds}
|
|
101
101
|
{showInactiveOrders}
|
|
102
102
|
{orderHash}
|
|
@@ -105,8 +105,8 @@ const AppTable = TanstackAppTable;
|
|
|
105
105
|
{tokensQuery}
|
|
106
106
|
{activeTokens}
|
|
107
107
|
{selectedTokens}
|
|
108
|
-
{
|
|
109
|
-
{
|
|
108
|
+
{activeRaindexAddresses}
|
|
109
|
+
{selectedRaindexAddresses}
|
|
110
110
|
{ownerFilter}
|
|
111
111
|
/>
|
|
112
112
|
|
|
@@ -116,7 +116,7 @@ const AppTable = TanstackAppTable;
|
|
|
116
116
|
emptyMessage="No Orders Found"
|
|
117
117
|
dataSelector={(page) => page.orders}
|
|
118
118
|
on:clickRow={(e) => {
|
|
119
|
-
goto(`/orders/${e.detail.item.chainId}-${e.detail.item.
|
|
119
|
+
goto(`/orders/${e.detail.item.chainId}-${e.detail.item.raindex}-${e.detail.item.orderHash}`);
|
|
120
120
|
}}
|
|
121
121
|
>
|
|
122
122
|
<svelte:fragment slot="title">
|
|
@@ -192,8 +192,8 @@ const AppTable = TanstackAppTable;
|
|
|
192
192
|
<Hash type={HashType.Wallet} value={item.owner} />
|
|
193
193
|
</div>
|
|
194
194
|
<div class="flex items-center gap-1">
|
|
195
|
-
<span class="text-gray-500 dark:text-gray-400">
|
|
196
|
-
<Hash type={HashType.Identifier} value={item.
|
|
195
|
+
<span class="text-gray-500 dark:text-gray-400">Raindex:</span>
|
|
196
|
+
<Hash type={HashType.Identifier} value={item.raindex} />
|
|
197
197
|
</div>
|
|
198
198
|
</div>
|
|
199
199
|
</TableBodyCell>
|
|
@@ -225,7 +225,7 @@ const AppTable = TanstackAppTable;
|
|
|
225
225
|
</TableBodyCell>
|
|
226
226
|
|
|
227
227
|
<TableBodyCell data-testid="orderListRowTrades" tdClass="break-word p-2">
|
|
228
|
-
{item.tradesCount
|
|
228
|
+
{item.tradesCount}
|
|
229
229
|
</TableBodyCell>
|
|
230
230
|
{#if $account && (handleTakeOrderModal || handleOrderRemoveModal)}
|
|
231
231
|
<TableBodyCell data-testid="orderListRowActions" tdClass="px-2 py-2">
|
|
@@ -250,6 +250,8 @@ const AppTable = TanstackAppTable;
|
|
|
250
250
|
data-testid={`order-menu-${item.id}`}
|
|
251
251
|
id={`order-menu-${item.id}`}
|
|
252
252
|
class="border-none px-2"
|
|
253
|
+
title="Order actions"
|
|
254
|
+
aria-label="Order actions"
|
|
253
255
|
on:click={(e) => {
|
|
254
256
|
e.stopPropagation();
|
|
255
257
|
}}
|
|
@@ -10,7 +10,7 @@ declare const __propDef: {
|
|
|
10
10
|
hideZeroBalanceVaults: AppStoresInterface["hideZeroBalanceVaults"];
|
|
11
11
|
hideInactiveOrdersVaults: AppStoresInterface["hideInactiveOrdersVaults"];
|
|
12
12
|
activeTokens: AppStoresInterface["activeTokens"];
|
|
13
|
-
|
|
13
|
+
activeRaindexAddresses: AppStoresInterface["activeRaindexAddresses"];
|
|
14
14
|
ownerFilter: AppStoresInterface["ownerFilter"];
|
|
15
15
|
};
|
|
16
16
|
events: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createInfiniteQuery } from "@tanstack/svelte-query";
|
|
3
3
|
import {
|
|
4
4
|
RaindexVault
|
|
5
|
-
} from "@rainlanguage/
|
|
5
|
+
} from "@rainlanguage/raindex";
|
|
6
6
|
import { formatTimestampSecondsAsLocal } from "../../services/time";
|
|
7
7
|
import Hash, { HashType } from "../Hash.svelte";
|
|
8
8
|
import { QKEY_VAULT_CHANGES } from "../../queries/keys";
|
|
@@ -12,7 +12,7 @@ import { goto } from "$app/navigation";
|
|
|
12
12
|
import { ArrowUpFromBracketOutline, DotsVerticalOutline } from "flowbite-svelte-icons";
|
|
13
13
|
import { createInfiniteQuery, createQuery } from "@tanstack/svelte-query";
|
|
14
14
|
import TanstackAppTable from "../TanstackAppTable.svelte";
|
|
15
|
-
import
|
|
15
|
+
import ListViewRaindexFilters from "../ListViewRaindexFilters.svelte";
|
|
16
16
|
import OrderOrVaultHash from "../OrderOrVaultHash.svelte";
|
|
17
17
|
import Hash, { HashType } from "../Hash.svelte";
|
|
18
18
|
import { DEFAULT_PAGE_SIZE, DEFAULT_REFRESH_INTERVAL } from "../../queries/constants";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
RaindexClient,
|
|
22
22
|
RaindexVault,
|
|
23
23
|
RaindexVaultsList
|
|
24
|
-
} from "@rainlanguage/
|
|
24
|
+
} from "@rainlanguage/raindex";
|
|
25
25
|
import { QKEY_TOKENS, QKEY_VAULTS } from "../../queries/keys";
|
|
26
26
|
import { useAccount } from "../../providers/wallet/useAccount";
|
|
27
27
|
import { getNetworkName } from "../../utils/getNetworkName";
|
|
@@ -36,7 +36,7 @@ export let hideZeroBalanceVaults;
|
|
|
36
36
|
export let hideInactiveOrdersVaults;
|
|
37
37
|
export let activeTokens;
|
|
38
38
|
export let selectedChainIds;
|
|
39
|
-
export let
|
|
39
|
+
export let activeRaindexAddresses;
|
|
40
40
|
export let ownerFilter;
|
|
41
41
|
export let handleDepositModal = void 0;
|
|
42
42
|
export let handleWithdrawModal = void 0;
|
|
@@ -57,18 +57,18 @@ $: tokensQuery = createQuery({
|
|
|
57
57
|
$: selectedTokens = $activeTokens?.filter(
|
|
58
58
|
(address) => !$tokensQuery.data || $tokensQuery.data.some((t) => t.address === address)
|
|
59
59
|
) ?? [];
|
|
60
|
-
$:
|
|
61
|
-
$:
|
|
60
|
+
$: raindexesMap = raindexClient.getAllRaindexes()?.value ?? /* @__PURE__ */ new Map();
|
|
61
|
+
$: availableRaindexAddresses = (() => {
|
|
62
62
|
const addrs = [];
|
|
63
|
-
|
|
63
|
+
raindexesMap.forEach((cfg) => {
|
|
64
64
|
if ($selectedChainIds.length === 0 || $selectedChainIds.includes(cfg.network.chainId)) {
|
|
65
65
|
addrs.push(cfg.address.toLowerCase());
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
return addrs;
|
|
69
69
|
})();
|
|
70
|
-
$:
|
|
71
|
-
(address) =>
|
|
70
|
+
$: selectedRaindexAddresses = $activeRaindexAddresses?.filter(
|
|
71
|
+
(address) => availableRaindexAddresses.includes(address.toLowerCase())
|
|
72
72
|
) ?? [];
|
|
73
73
|
$: query = createInfiniteQuery({
|
|
74
74
|
queryKey: [
|
|
@@ -78,7 +78,7 @@ $: query = createInfiniteQuery({
|
|
|
78
78
|
$selectedChainIds,
|
|
79
79
|
ownerAddress,
|
|
80
80
|
selectedTokens,
|
|
81
|
-
|
|
81
|
+
selectedRaindexAddresses
|
|
82
82
|
],
|
|
83
83
|
queryFn: async ({ pageParam }) => {
|
|
84
84
|
const result = await raindexClient.getVaults(
|
|
@@ -87,17 +87,18 @@ $: query = createInfiniteQuery({
|
|
|
87
87
|
owners,
|
|
88
88
|
hideZeroBalance: $hideZeroBalanceVaults,
|
|
89
89
|
tokens: selectedTokens,
|
|
90
|
-
|
|
90
|
+
raindexAddresses: selectedRaindexAddresses.length > 0 ? selectedRaindexAddresses : void 0,
|
|
91
91
|
onlyActiveOrders: $hideInactiveOrdersVaults
|
|
92
92
|
},
|
|
93
|
-
pageParam + 1
|
|
93
|
+
pageParam + 1,
|
|
94
|
+
DEFAULT_PAGE_SIZE
|
|
94
95
|
);
|
|
95
96
|
if (result.error) throw new Error(result.error.readableMsg);
|
|
96
97
|
return result.value;
|
|
97
98
|
},
|
|
98
99
|
initialPageParam: 0,
|
|
99
100
|
getNextPageParam(lastPage, _allPages, lastPageParam) {
|
|
100
|
-
return lastPage.
|
|
101
|
+
return lastPage.hasMore ? lastPageParam + 1 : void 0;
|
|
101
102
|
},
|
|
102
103
|
refetchInterval: DEFAULT_REFRESH_INTERVAL,
|
|
103
104
|
enabled: true
|
|
@@ -133,7 +134,7 @@ const handleWithdrawAll = () => {
|
|
|
133
134
|
try {
|
|
134
135
|
const filteredVaultListResults = pages.reduce(
|
|
135
136
|
(prev, cur) => {
|
|
136
|
-
const result = cur.pickByIds(selectedIds);
|
|
137
|
+
const result = cur.vaults.pickByIds(selectedIds);
|
|
137
138
|
if (result.error) {
|
|
138
139
|
throw new Error(result.error.readableMsg);
|
|
139
140
|
}
|
|
@@ -175,7 +176,7 @@ const AppTable = TanstackAppTable;
|
|
|
175
176
|
</script>
|
|
176
177
|
|
|
177
178
|
{#if $query}
|
|
178
|
-
<
|
|
179
|
+
<ListViewRaindexFilters
|
|
179
180
|
{selectedChainIds}
|
|
180
181
|
{showInactiveOrders}
|
|
181
182
|
{orderHash}
|
|
@@ -184,8 +185,8 @@ const AppTable = TanstackAppTable;
|
|
|
184
185
|
{activeTokens}
|
|
185
186
|
{tokensQuery}
|
|
186
187
|
{selectedTokens}
|
|
187
|
-
{
|
|
188
|
-
{
|
|
188
|
+
{activeRaindexAddresses}
|
|
189
|
+
{selectedRaindexAddresses}
|
|
189
190
|
{ownerFilter}
|
|
190
191
|
/>
|
|
191
192
|
<AppTable
|
|
@@ -194,7 +195,7 @@ const AppTable = TanstackAppTable;
|
|
|
194
195
|
queryKey={QKEY_VAULTS}
|
|
195
196
|
emptyMessage="No Vaults Found"
|
|
196
197
|
on:clickRow={(e) => {
|
|
197
|
-
goto(`/vaults/${e.detail.item.chainId}-${e.detail.item.
|
|
198
|
+
goto(`/vaults/${e.detail.item.chainId}-${e.detail.item.raindex}-${e.detail.item.id}`);
|
|
198
199
|
}}
|
|
199
200
|
>
|
|
200
201
|
<svelte:fragment slot="title">
|
|
@@ -259,8 +260,8 @@ const AppTable = TanstackAppTable;
|
|
|
259
260
|
<Hash type={HashType.Identifier} value={toHex(item.vaultId)} />
|
|
260
261
|
</div>
|
|
261
262
|
<div class="flex items-center gap-1">
|
|
262
|
-
<span class="text-gray-500 dark:text-gray-400">
|
|
263
|
-
<Hash type={HashType.Identifier} value={item.
|
|
263
|
+
<span class="text-gray-500 dark:text-gray-400">Raindex:</span>
|
|
264
|
+
<Hash type={HashType.Identifier} value={item.raindex} />
|
|
264
265
|
</div>
|
|
265
266
|
<div class="flex items-center gap-1">
|
|
266
267
|
<span class="text-gray-500 dark:text-gray-400">Owner:</span>
|
|
@@ -284,7 +285,7 @@ const AppTable = TanstackAppTable;
|
|
|
284
285
|
type="orders"
|
|
285
286
|
orderOrVault={order}
|
|
286
287
|
chainId={item.chainId}
|
|
287
|
-
|
|
288
|
+
raindexAddress={item.raindex}
|
|
288
289
|
/>
|
|
289
290
|
{/each}
|
|
290
291
|
{#if item.ordersAsInput.length > 3}...{/if}
|
|
@@ -299,7 +300,7 @@ const AppTable = TanstackAppTable;
|
|
|
299
300
|
type="orders"
|
|
300
301
|
orderOrVault={order}
|
|
301
302
|
chainId={item.chainId}
|
|
302
|
-
|
|
303
|
+
raindexAddress={item.raindex}
|
|
303
304
|
/>
|
|
304
305
|
{/each}
|
|
305
306
|
{#if item.ordersAsOutput.length > 3}...{/if}
|
|
@@ -314,6 +315,8 @@ const AppTable = TanstackAppTable;
|
|
|
314
315
|
data-testid="vault-menu"
|
|
315
316
|
id={`vault-menu-${item.id}`}
|
|
316
317
|
class="mr-2 border-none px-2"
|
|
318
|
+
title="Vault actions"
|
|
319
|
+
aria-label="Vault actions"
|
|
317
320
|
on:click={(e) => {
|
|
318
321
|
e.stopPropagation();
|
|
319
322
|
}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { RaindexClient, RaindexVault, RaindexVaultsList } from '@rainlanguage/
|
|
2
|
+
import { RaindexClient, RaindexVault, RaindexVaultsList } from '@rainlanguage/raindex';
|
|
3
3
|
import type { AppStoresInterface } from '../../types/appStores.ts';
|
|
4
4
|
import { getAllContexts } from 'svelte';
|
|
5
5
|
declare const __propDef: {
|
|
@@ -10,7 +10,7 @@ declare const __propDef: {
|
|
|
10
10
|
hideInactiveOrdersVaults: AppStoresInterface["hideInactiveOrdersVaults"];
|
|
11
11
|
activeTokens: AppStoresInterface["activeTokens"];
|
|
12
12
|
selectedChainIds: AppStoresInterface["selectedChainIds"];
|
|
13
|
-
|
|
13
|
+
activeRaindexAddresses: AppStoresInterface["activeRaindexAddresses"];
|
|
14
14
|
ownerFilter: AppStoresInterface["ownerFilter"];
|
|
15
15
|
handleDepositModal?: ((vault: RaindexVault, refetch: () => void, context: ReturnType<typeof getAllContexts>) => void) | undefined;
|
|
16
16
|
handleWithdrawModal?: ((vault: RaindexVault, refetch: () => void, context: ReturnType<typeof getAllContexts>) => void) | undefined;
|
|
@@ -54,6 +54,7 @@ function dismissTransaction() {
|
|
|
54
54
|
<button
|
|
55
55
|
on:click={dismissTransaction}
|
|
56
56
|
class="flex-shrink-0 p-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
|
|
57
|
+
title="Dismiss transaction"
|
|
57
58
|
aria-label="Dismiss transaction"
|
|
58
59
|
>
|
|
59
60
|
<CloseOutline class="h-4 w-4" />
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TransactionStatusMessage } from
|
|
1
|
+
import { TransactionStatusMessage } from "../../types/transaction";
|
|
2
2
|
export declare function getStatusEmoji(status: TransactionStatusMessage): string;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { TransactionStatusMessage } from
|
|
2
|
-
import { match } from
|
|
1
|
+
import { TransactionStatusMessage } from "../../types/transaction";
|
|
2
|
+
import { match } from "ts-pattern";
|
|
3
3
|
export function getStatusEmoji(status) {
|
|
4
4
|
return match(status)
|
|
5
|
-
.with(TransactionStatusMessage.PENDING_RECEIPT, () =>
|
|
6
|
-
.with(TransactionStatusMessage.PENDING_SUBGRAPH, () =>
|
|
7
|
-
.with(TransactionStatusMessage.SUCCESS, () =>
|
|
8
|
-
.with(TransactionStatusMessage.ERROR, () =>
|
|
9
|
-
.otherwise(() =>
|
|
5
|
+
.with(TransactionStatusMessage.PENDING_RECEIPT, () => "🔄")
|
|
6
|
+
.with(TransactionStatusMessage.PENDING_SUBGRAPH, () => "📊")
|
|
7
|
+
.with(TransactionStatusMessage.SUCCESS, () => "✅")
|
|
8
|
+
.with(TransactionStatusMessage.ERROR, () => "❌")
|
|
9
|
+
.otherwise(() => "❓");
|
|
10
10
|
}
|
|
11
11
|
if (import.meta.vitest) {
|
|
12
|
-
describe(
|
|
13
|
-
it(
|
|
14
|
-
expect(getStatusEmoji(TransactionStatusMessage.PENDING_RECEIPT)).toBe(
|
|
15
|
-
expect(getStatusEmoji(TransactionStatusMessage.PENDING_SUBGRAPH)).toBe(
|
|
16
|
-
expect(getStatusEmoji(TransactionStatusMessage.SUCCESS)).toBe(
|
|
17
|
-
expect(getStatusEmoji(TransactionStatusMessage.ERROR)).toBe(
|
|
12
|
+
describe("getStatusEmoji", () => {
|
|
13
|
+
it("should return the correct emoji for each status", () => {
|
|
14
|
+
expect(getStatusEmoji(TransactionStatusMessage.PENDING_RECEIPT)).toBe("🔄");
|
|
15
|
+
expect(getStatusEmoji(TransactionStatusMessage.PENDING_SUBGRAPH)).toBe("📊");
|
|
16
|
+
expect(getStatusEmoji(TransactionStatusMessage.SUCCESS)).toBe("✅");
|
|
17
|
+
expect(getStatusEmoji(TransactionStatusMessage.ERROR)).toBe("❌");
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
}
|
package/dist/consts.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LICENSE_URL =
|
|
1
|
+
export const LICENSE_URL = "https://raw.githubusercontent.com/rainlanguage/decentralicense/refs/heads/master/README.md";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writable } from
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
2
|
export var DeploymentStepsErrorCode;
|
|
3
3
|
(function (DeploymentStepsErrorCode) {
|
|
4
4
|
DeploymentStepsErrorCode["NO_BUILDER_PROVIDER"] = "No builder provider found.";
|
|
@@ -29,7 +29,7 @@ export class DeploymentStepsError extends Error {
|
|
|
29
29
|
super(code);
|
|
30
30
|
this.code = code;
|
|
31
31
|
this.details = details;
|
|
32
|
-
this.name =
|
|
32
|
+
this.name = "DeploymentStepsError";
|
|
33
33
|
}
|
|
34
34
|
static get error() {
|
|
35
35
|
return this.errorStore;
|
|
@@ -43,7 +43,7 @@ export class DeploymentStepsError extends Error {
|
|
|
43
43
|
static catch(e, code) {
|
|
44
44
|
const error = e instanceof DeploymentStepsError
|
|
45
45
|
? e
|
|
46
|
-
: new DeploymentStepsError(code, e instanceof Error ? e.message :
|
|
46
|
+
: new DeploymentStepsError(code, e instanceof Error ? e.message : "Unknown error");
|
|
47
47
|
this.errorStore.set(error);
|
|
48
48
|
}
|
|
49
49
|
static clear() {
|
package/dist/errors/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./DeploymentStepsError";
|
package/dist/errors/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./DeploymentStepsError";
|
package/dist/hooks/useLocalDb.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getContext } from
|
|
2
|
-
import { DeploymentStepsError, DeploymentStepsErrorCode } from
|
|
3
|
-
export const LOCAL_DB_CONTEXT_KEY =
|
|
1
|
+
import { getContext } from "svelte";
|
|
2
|
+
import { DeploymentStepsError, DeploymentStepsErrorCode, } from "../errors/DeploymentStepsError";
|
|
3
|
+
export const LOCAL_DB_CONTEXT_KEY = "local-db-context";
|
|
4
4
|
export function useLocalDb() {
|
|
5
5
|
const db = getContext(LOCAL_DB_CONTEXT_KEY);
|
|
6
6
|
if (!db) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getContext } from
|
|
2
|
-
import { RaindexClient } from
|
|
3
|
-
import { DeploymentStepsError, DeploymentStepsErrorCode } from
|
|
4
|
-
export const RAINDEX_CLIENT_CONTEXT_KEY =
|
|
1
|
+
import { getContext } from "svelte";
|
|
2
|
+
import { RaindexClient } from "@rainlanguage/raindex";
|
|
3
|
+
import { DeploymentStepsError, DeploymentStepsErrorCode, } from "../errors/DeploymentStepsError";
|
|
4
|
+
export const RAINDEX_CLIENT_CONTEXT_KEY = "raindex-client-context";
|
|
5
5
|
export function useRaindexClient() {
|
|
6
6
|
const raindexClient = getContext(RAINDEX_CLIENT_CONTEXT_KEY);
|
|
7
7
|
if (!raindexClient) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RaindexOrderBuilder } from
|
|
1
|
+
import { RaindexOrderBuilder } from "@rainlanguage/raindex";
|
|
2
2
|
export declare const RAINDEX_ORDER_BUILDER_CONTEXT_KEY = "raindex-order-builder-context";
|
|
3
3
|
export declare function useRaindexOrderBuilder(): RaindexOrderBuilder;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getContext } from
|
|
2
|
-
import { RaindexOrderBuilder } from
|
|
3
|
-
import { DeploymentStepsError, DeploymentStepsErrorCode } from
|
|
4
|
-
export const RAINDEX_ORDER_BUILDER_CONTEXT_KEY =
|
|
1
|
+
import { getContext } from "svelte";
|
|
2
|
+
import { RaindexOrderBuilder } from "@rainlanguage/raindex";
|
|
3
|
+
import { DeploymentStepsError, DeploymentStepsErrorCode, } from "../errors/DeploymentStepsError";
|
|
4
|
+
export const RAINDEX_ORDER_BUILDER_CONTEXT_KEY = "raindex-order-builder-context";
|
|
5
5
|
export function useRaindexOrderBuilder() {
|
|
6
6
|
const builder = getContext(RAINDEX_ORDER_BUILDER_CONTEXT_KEY);
|
|
7
7
|
if (!builder) {
|