@rainlanguage/ui-components 0.0.1-alpha.20 → 0.0.1-alpha.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__fixtures__/settings.yaml +125 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte +4 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte.d.ts +18 -0
- package/dist/__mocks__/MockComponent.svelte +4 -0
- package/dist/__mocks__/MockComponent.svelte.d.ts +3 -1
- package/dist/__mocks__/stores.d.ts +47 -33
- package/dist/__mocks__/stores.js +61 -38
- package/dist/components/ButtonLoading.svelte +1 -1
- package/dist/components/ButtonVaultLink.svelte +11 -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/CheckboxMyItemsOnly.svelte +3 -2
- package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +2 -3
- package/dist/components/CheckboxZeroBalanceVault.svelte.d.ts +2 -2
- package/dist/components/CodeMirrorDotrain.svelte +4 -0
- package/dist/components/CodeMirrorDotrain.svelte.d.ts +1 -0
- package/dist/components/CodeMirrorRainlang.svelte +3 -12
- package/dist/components/CodeMirrorRainlang.svelte.d.ts +2 -2
- package/dist/components/EditableSpan.svelte +3 -14
- package/dist/components/EditableSpan.svelte.d.ts +0 -1
- package/dist/components/Hash.svelte +3 -3
- package/dist/components/License.svelte +5 -4
- package/dist/components/ListViewOrderbookFilters.svelte +45 -23
- package/dist/components/ListViewOrderbookFilters.svelte.d.ts +27 -22
- package/dist/components/LocalDbStatusBadge.svelte +27 -0
- package/dist/components/LocalDbStatusBadge.svelte.d.ts +19 -0
- package/dist/components/LocalDbStatusCard.svelte +40 -0
- package/dist/components/LocalDbStatusCard.svelte.d.ts +20 -0
- package/dist/components/LocalDbStatusModal.svelte +103 -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/TanstackAppTable.svelte +179 -28
- package/dist/components/TanstackAppTable.svelte.d.ts +14 -8
- 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 +300 -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 +2 -1
- package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +1 -4
- package/dist/components/deployment/DeploymentSectionHeader.svelte +7 -4
- package/dist/components/deployment/DeploymentSteps.svelte +209 -216
- 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 +8 -10
- package/dist/components/deployment/DepositInput.svelte.d.ts +1 -2
- package/dist/components/deployment/DisclaimerModal.svelte +6 -7
- package/dist/components/deployment/FieldDefinitionInput.svelte +7 -11
- package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +1 -2
- 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 +125 -48
- package/dist/components/deployment/SelectToken.svelte.d.ts +4 -3
- package/dist/components/deployment/TokenBalance.svelte +19 -0
- package/dist/components/deployment/TokenBalance.svelte.d.ts +19 -0
- package/dist/components/deployment/TokenIOInput.svelte +31 -16
- 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 +181 -83
- package/dist/components/detail/OrderDetail.svelte.d.ts +18 -15
- package/dist/components/detail/TanstackOrderQuote.svelte +92 -46
- package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +14 -16
- package/dist/components/detail/VaultDetail.svelte +78 -77
- 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/DropdownOrderListAccounts.svelte +5 -2
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +2 -3
- package/dist/components/dropdown/DropdownOrderbooksFilter.svelte +172 -0
- package/dist/components/dropdown/DropdownOrderbooksFilter.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 +2 -1
- package/dist/components/icon/Refresh.svelte.d.ts +1 -0
- package/dist/components/input/InputOrderHash.svelte +1 -1
- package/dist/components/input/InputOrderHash.svelte.d.ts +3 -3
- package/dist/components/input/InputRegistryUrl.svelte +36 -14
- package/dist/components/input/InputToken.svelte +2 -2
- package/dist/components/input/InputTokenAmount.svelte +16 -21
- 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 +84 -81
- 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 +139 -122
- package/dist/components/tables/OrdersListTable.svelte.d.ts +16 -22
- package/dist/components/tables/VaultBalanceChangesTable.svelte +83 -43
- package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +13 -11
- package/dist/components/tables/VaultsListTable.svelte +268 -145
- package/dist/components/tables/VaultsListTable.svelte.d.ts +24 -32
- package/dist/components/transactions/FixedBottomTransaction.svelte +63 -0
- package/dist/components/transactions/FixedBottomTransaction.svelte.d.ts +16 -0
- package/dist/components/transactions/TransactionDetail.svelte +31 -0
- package/dist/components/transactions/TransactionDetail.svelte.d.ts +20 -0
- package/dist/components/transactions/TransactionList.svelte +17 -0
- package/dist/components/transactions/TransactionList.svelte.d.ts +16 -0
- package/dist/components/transactions/getStatusEmoji.d.ts +2 -0
- package/dist/components/transactions/getStatusEmoji.js +20 -0
- package/dist/components/wallet/WalletConnect.svelte +5 -4
- package/dist/components/wallet/WalletConnect.svelte.d.ts +0 -1
- package/dist/consts.d.ts +1 -0
- package/dist/consts.js +1 -0
- package/dist/errors/DeploymentStepsError.d.ts +8 -2
- package/dist/errors/DeploymentStepsError.js +7 -1
- package/dist/hooks/useGui.d.ts +1 -1
- package/dist/hooks/useGui.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/index.d.ts +42 -19
- package/dist/index.js +41 -16
- package/dist/models/Transaction.d.ts +75 -0
- package/dist/models/Transaction.js +100 -0
- package/dist/providers/GuiProvider.svelte +1 -1
- package/dist/providers/GuiProvider.svelte.d.ts +1 -1
- 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/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 +40 -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 +133 -0
- package/dist/providers/registry/RegistryProvider.svelte +6 -0
- package/dist/providers/registry/RegistryProvider.svelte.d.ts +21 -0
- package/dist/providers/registry/context.d.ts +10 -0
- package/dist/providers/registry/context.js +46 -0
- package/dist/providers/registry/useRegistry.d.ts +7 -0
- package/dist/providers/registry/useRegistry.js +29 -0
- package/dist/providers/toasts/ToastProvider.svelte +17 -0
- package/dist/providers/toasts/ToastProvider.svelte.d.ts +18 -0
- package/dist/providers/toasts/context.d.ts +14 -0
- package/dist/providers/toasts/context.js +22 -0
- package/dist/providers/toasts/useToasts.d.ts +16 -0
- package/dist/providers/toasts/useToasts.js +63 -0
- package/dist/providers/transactions/TransactionManager.d.ts +214 -0
- package/dist/providers/transactions/TransactionManager.js +466 -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 +1 -0
- package/dist/queries/queryClient.d.ts +1 -1
- package/dist/queries/queryClient.js +11 -6
- package/dist/services/awaitTransactionIndexing.d.ts +107 -0
- package/dist/services/awaitTransactionIndexing.js +58 -0
- package/dist/services/getExplorerLink.d.ts +1 -1
- package/dist/services/getExplorerLink.js +2 -4
- package/dist/services/handleShareChoices.d.ts +2 -2
- package/dist/services/handleShareChoices.js +7 -2
- package/dist/services/historicalOrderCharts.d.ts +2 -2
- package/dist/services/historicalOrderCharts.js +267 -333
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.js +2 -1
- package/dist/services/loadRegistryUrl.d.ts +2 -0
- package/dist/services/loadRegistryUrl.js +22 -0
- package/dist/services/pairTradesChartData.d.ts +47 -0
- package/dist/services/pairTradesChartData.js +190 -0
- package/dist/services/registry.d.ts +5 -5
- package/dist/services/registry.js +8 -208
- package/dist/services/time.d.ts +12 -0
- package/dist/services/time.js +88 -6
- package/dist/storesGeneric/cachedWritableStore.d.ts +57 -0
- package/dist/storesGeneric/cachedWritableStore.js +93 -0
- package/dist/types/account.d.ts +3 -0
- package/dist/types/appStores.d.ts +9 -14
- package/dist/types/modal.d.ts +26 -14
- package/dist/types/{strategy.d.ts → order.d.ts} +3 -3
- 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 +65 -22
- package/dist/types/transaction.js +30 -1
- 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 +115 -0
- package/dist/utils/getNetworkName.d.ts +1 -0
- package/dist/utils/getNetworkName.js +13 -0
- package/dist/utils/number.d.ts +0 -7
- package/dist/utils/number.js +0 -27
- 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 +39 -34
- 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/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 -24
- 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/DropdownOrderStatus.svelte +0 -31
- package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +0 -19
- package/dist/stores/transactionStore.d.ts +0 -98
- package/dist/stores/transactionStore.js +0 -303
- package/dist/utils/time.d.ts +0 -12
- package/dist/utils/time.js +0 -27
- package/dist/utils/vault.d.ts +0 -2
- package/dist/utils/vault.js +0 -29
- /package/dist/types/{strategy.js → account.js} +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
<script>import { Input, Button, Modal } from "flowbite-svelte";
|
|
2
|
+
import { SearchOutline, CheckCircleSolid, ChevronDownSolid } from "flowbite-svelte-icons";
|
|
3
|
+
import { useGui } from "../../hooks/useGui";
|
|
4
|
+
import { onMount, tick } from "svelte";
|
|
5
|
+
export let selectedToken = null;
|
|
6
|
+
export let onSelect;
|
|
7
|
+
let modalOpen = false;
|
|
8
|
+
let searchQuery = "";
|
|
9
|
+
let tokens = [];
|
|
10
|
+
let isSearching = false;
|
|
11
|
+
let failedImages = /* @__PURE__ */ new Set();
|
|
12
|
+
const gui = useGui();
|
|
13
|
+
async function loadTokens(search) {
|
|
14
|
+
isSearching = true;
|
|
15
|
+
const result = await gui.getAllTokens(search);
|
|
16
|
+
if (result.error) {
|
|
17
|
+
tokens = [];
|
|
18
|
+
} else {
|
|
19
|
+
tokens = result.value;
|
|
20
|
+
}
|
|
21
|
+
isSearching = false;
|
|
22
|
+
}
|
|
23
|
+
function handleSearch(event) {
|
|
24
|
+
const target = event.target;
|
|
25
|
+
searchQuery = target.value;
|
|
26
|
+
loadTokens(searchQuery || void 0);
|
|
27
|
+
}
|
|
28
|
+
onMount(() => loadTokens());
|
|
29
|
+
function formatAddress(address) {
|
|
30
|
+
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
31
|
+
}
|
|
32
|
+
function handleTokenSelect(token) {
|
|
33
|
+
onSelect(token);
|
|
34
|
+
modalOpen = false;
|
|
35
|
+
}
|
|
36
|
+
function handleImageError(address) {
|
|
37
|
+
failedImages = /* @__PURE__ */ new Set([...failedImages, address]);
|
|
38
|
+
}
|
|
39
|
+
$: displayText = selectedToken ? `${selectedToken.name} (${selectedToken.symbol})` : "Select a token...";
|
|
40
|
+
$: if (modalOpen) {
|
|
41
|
+
tick().then(() => {
|
|
42
|
+
const input = document.querySelector(".token-search-input");
|
|
43
|
+
if (input) {
|
|
44
|
+
input.focus();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<div class="token-dropdown">
|
|
51
|
+
<div class="relative w-full">
|
|
52
|
+
<Button
|
|
53
|
+
color="alternative"
|
|
54
|
+
class="flex w-full justify-between overflow-hidden overflow-ellipsis pl-4 pr-2 text-left"
|
|
55
|
+
size="lg"
|
|
56
|
+
on:click={() => (modalOpen = true)}
|
|
57
|
+
>
|
|
58
|
+
<div class="flex-grow overflow-hidden">
|
|
59
|
+
<span class="text-gray-900 dark:text-white">{displayText}</span>
|
|
60
|
+
</div>
|
|
61
|
+
<ChevronDownSolid class="ml-2 h-4 w-4 text-black dark:text-white" />
|
|
62
|
+
</Button>
|
|
63
|
+
|
|
64
|
+
<Modal bind:open={modalOpen} size="md" class="w-full max-w-lg">
|
|
65
|
+
<div slot="header" class="flex w-full items-center justify-between">
|
|
66
|
+
<h3 class="text-xl font-medium text-gray-900 dark:text-white">Select a token</h3>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="relative w-full border-b border-gray-200 p-2 dark:border-gray-600">
|
|
69
|
+
<div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-5">
|
|
70
|
+
<SearchOutline class="h-4 w-4 text-gray-500 dark:text-gray-400" />
|
|
71
|
+
</div>
|
|
72
|
+
<Input
|
|
73
|
+
type="text"
|
|
74
|
+
placeholder="Search tokens..."
|
|
75
|
+
bind:value={searchQuery}
|
|
76
|
+
on:input={handleSearch}
|
|
77
|
+
class="token-search-input pl-10"
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div class="token-list max-h-80 overflow-y-auto">
|
|
82
|
+
{#if isSearching}
|
|
83
|
+
<div class="p-4 text-center text-gray-500 dark:text-gray-400">
|
|
84
|
+
<p>Searching tokens...</p>
|
|
85
|
+
</div>
|
|
86
|
+
{:else}
|
|
87
|
+
{#each tokens as token (token.address)}
|
|
88
|
+
<div
|
|
89
|
+
class="token-item flex cursor-pointer items-center border-b border-gray-100 p-3 last:border-b-0 hover:bg-gray-50 dark:border-gray-600 dark:hover:bg-gray-700"
|
|
90
|
+
class:bg-blue-50={selectedToken?.address === token.address}
|
|
91
|
+
class:dark:bg-blue-900={selectedToken?.address === token.address}
|
|
92
|
+
class:border-l-4={selectedToken?.address === token.address}
|
|
93
|
+
class:border-l-blue-500={selectedToken?.address === token.address}
|
|
94
|
+
on:click={() => handleTokenSelect(token)}
|
|
95
|
+
on:keydown={(e) => e.key === 'Enter' && handleTokenSelect(token)}
|
|
96
|
+
role="button"
|
|
97
|
+
tabindex="0"
|
|
98
|
+
>
|
|
99
|
+
{#if token.logoUri && !failedImages.has(token.address)}
|
|
100
|
+
<img
|
|
101
|
+
src={token.logoUri}
|
|
102
|
+
alt="{token.symbol} logo"
|
|
103
|
+
class="mr-3 h-8 w-8 rounded-full object-cover"
|
|
104
|
+
on:error={() => handleImageError(token.address)}
|
|
105
|
+
/>
|
|
106
|
+
{:else}
|
|
107
|
+
<div
|
|
108
|
+
class="mr-3 flex h-8 w-8 items-center justify-center rounded-full bg-gray-200 dark:bg-gray-600"
|
|
109
|
+
>
|
|
110
|
+
<span class="text-xs font-medium text-gray-500 dark:text-gray-400">
|
|
111
|
+
{token.symbol?.slice(0, 2) || '??'}
|
|
112
|
+
</span>
|
|
113
|
+
</div>
|
|
114
|
+
{/if}
|
|
115
|
+
<div class="token-info flex-grow">
|
|
116
|
+
<div class="token-name font-medium text-gray-900 dark:text-white">
|
|
117
|
+
{token.name}
|
|
118
|
+
</div>
|
|
119
|
+
<div class="token-details flex gap-2 text-sm text-gray-500 dark:text-gray-400">
|
|
120
|
+
<span class="symbol font-medium">{token.symbol}</span>
|
|
121
|
+
<span class="address">{formatAddress(token.address)}</span>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
{#if selectedToken?.address === token.address}
|
|
125
|
+
<CheckCircleSolid class="selected-icon h-5 w-5 text-green-500" />
|
|
126
|
+
{/if}
|
|
127
|
+
</div>
|
|
128
|
+
{/each}
|
|
129
|
+
|
|
130
|
+
{#if tokens.length === 0}
|
|
131
|
+
<div class="no-results p-4 text-center text-gray-500 dark:text-gray-400">
|
|
132
|
+
<p>No tokens found matching your search.</p>
|
|
133
|
+
<button
|
|
134
|
+
class="mt-2 text-blue-600 underline hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300"
|
|
135
|
+
on:click={() => {
|
|
136
|
+
searchQuery = '';
|
|
137
|
+
loadTokens();
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
140
|
+
Clear search
|
|
141
|
+
</button>
|
|
142
|
+
</div>
|
|
143
|
+
{/if}
|
|
144
|
+
{/if}
|
|
145
|
+
</div>
|
|
146
|
+
</Modal>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ExtendedTokenInfo } from '@rainlanguage/orderbook';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
selectedToken?: ExtendedTokenInfo | null;
|
|
6
|
+
onSelect: (token: ExtendedTokenInfo) => void;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type TokenSelectionModalProps = typeof __propDef.props;
|
|
16
|
+
export type TokenSelectionModalEvents = typeof __propDef.events;
|
|
17
|
+
export type TokenSelectionModalSlots = typeof __propDef.slots;
|
|
18
|
+
export default class TokenSelectionModal extends SvelteComponent<TokenSelectionModalProps, TokenSelectionModalEvents, TokenSelectionModalSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
package/dist/components/deployment/{ValidStrategiesSection.svelte → ValidOrdersSection.svelte}
RENAMED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<script>import { onMount } from "svelte";
|
|
2
2
|
import { page } from "$app/stores";
|
|
3
|
-
export let
|
|
3
|
+
export let orders;
|
|
4
4
|
let customRegistryParam = "";
|
|
5
5
|
onMount(async () => {
|
|
6
6
|
customRegistryParam = $page.url.searchParams.get("registry") ? `?registry=${$page.url.searchParams.get("registry")}` : "";
|
|
7
7
|
});
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
|
-
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3" data-testid="valid-
|
|
11
|
-
{#each
|
|
10
|
+
<div class="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3" data-testid="valid-orders">
|
|
11
|
+
{#each orders as order}
|
|
12
12
|
<a
|
|
13
|
-
href={`/deploy/${
|
|
14
|
-
data-testid="
|
|
13
|
+
href={`/deploy/${order.name}${customRegistryParam}`}
|
|
14
|
+
data-testid="order-short-tile"
|
|
15
15
|
class="flex flex-col gap-y-2 rounded-xl border border-gray-200 p-4 hover:bg-gray-50 dark:border-gray-800 dark:hover:bg-gray-900"
|
|
16
16
|
>
|
|
17
17
|
<h3 class="text-2xl font-semibold text-gray-900 dark:text-white">
|
|
18
|
-
{
|
|
18
|
+
{order.details.name}
|
|
19
19
|
</h3>
|
|
20
20
|
<p class="text-lg text-gray-600 dark:text-gray-400">
|
|
21
|
-
{
|
|
21
|
+
{order.details.short_description}
|
|
22
22
|
</p>
|
|
23
23
|
</a>
|
|
24
24
|
{/each}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ValidOrderDetail } from '../../types/order';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
orders: ValidOrderDetail[];
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type ValidOrdersSectionProps = typeof __propDef.props;
|
|
15
|
+
export type ValidOrdersSectionEvents = typeof __propDef.events;
|
|
16
|
+
export type ValidOrdersSectionSlots = typeof __propDef.slots;
|
|
17
|
+
export default class ValidOrdersSection extends SvelteComponent<ValidOrdersSectionProps, ValidOrdersSectionEvents, ValidOrdersSectionSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script>import TokenBalanceComponent from "./TokenBalance.svelte";
|
|
2
|
+
export let title;
|
|
3
|
+
export let description;
|
|
4
|
+
export let tokenBalance;
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class="flex max-w-xl flex-grow flex-col gap-y-4 text-left">
|
|
8
|
+
<h1 class="break-words text-xl font-semibold text-gray-900 lg:text-2xl dark:text-white">
|
|
9
|
+
{title}
|
|
10
|
+
</h1>
|
|
11
|
+
<div class="flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400">
|
|
12
|
+
<div class="text-gray-600 dark:text-gray-400">
|
|
13
|
+
{description}
|
|
14
|
+
</div>
|
|
15
|
+
<TokenBalanceComponent {tokenBalance} />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { TokenBalance } from '../../types/tokenBalance';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
tokenBalance: TokenBalance | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
exports?: {} | undefined;
|
|
14
|
+
bindings?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type VaultIdInformationProps = typeof __propDef.props;
|
|
17
|
+
export type VaultIdInformationEvents = typeof __propDef.events;
|
|
18
|
+
export type VaultIdInformationSlots = typeof __propDef.slots;
|
|
19
|
+
export default class VaultIdInformation extends SvelteComponent<VaultIdInformationProps, VaultIdInformationEvents, VaultIdInformationSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -5,52 +5,87 @@ import OrderTradesListTable from "../tables/OrderTradesListTable.svelte";
|
|
|
5
5
|
import TanstackOrderQuote from "./TanstackOrderQuote.svelte";
|
|
6
6
|
import TanstackPageContentDetail from "./TanstackPageContentDetail.svelte";
|
|
7
7
|
import CardProperty from "../CardProperty.svelte";
|
|
8
|
-
import { formatTimestampSecondsAsLocal } from "../../
|
|
8
|
+
import { formatTimestampSecondsAsLocal } from "../../services/time";
|
|
9
9
|
import ButtonVaultLink from "../ButtonVaultLink.svelte";
|
|
10
10
|
import OrderVaultsVolTable from "../tables/OrderVaultsVolTable.svelte";
|
|
11
11
|
import { QKEY_ORDER } from "../../queries/keys";
|
|
12
12
|
import CodeMirrorRainlang from "../CodeMirrorRainlang.svelte";
|
|
13
|
-
import { getOrderByHash } from "@rainlanguage/orderbook/js_api";
|
|
14
13
|
import { createQuery, useQueryClient } from "@tanstack/svelte-query";
|
|
15
14
|
import { Button, TabItem, Tabs, Tooltip } from "flowbite-svelte";
|
|
16
15
|
import { onDestroy } from "svelte";
|
|
17
|
-
import OrderApy from "../tables/OrderAPY.svelte";
|
|
18
|
-
import { page } from "$app/stores";
|
|
19
|
-
import DepositOrWithdrawButtons from "./DepositOrWithdrawButtons.svelte";
|
|
20
16
|
import Refresh from "../icon/Refresh.svelte";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
import { invalidateTanstackQueries } from "../../queries/queryClient";
|
|
18
|
+
import {
|
|
19
|
+
ArrowDownToBracketOutline,
|
|
20
|
+
ArrowUpFromBracketOutline,
|
|
21
|
+
InfoCircleOutline,
|
|
22
|
+
WalletOutline
|
|
23
|
+
} from "flowbite-svelte-icons";
|
|
24
|
+
import { getExplorerLink } from "../../services/getExplorerLink";
|
|
25
|
+
import { useAccount } from "../../providers/wallet/useAccount";
|
|
26
|
+
import {
|
|
27
|
+
RaindexClient,
|
|
28
|
+
RaindexOrder,
|
|
29
|
+
RaindexVault,
|
|
30
|
+
RaindexVaultsList
|
|
31
|
+
} from "@rainlanguage/orderbook";
|
|
32
|
+
import { useToasts } from "../../providers/toasts/useToasts";
|
|
33
|
+
import { useRaindexClient } from "../../hooks/useRaindexClient";
|
|
25
34
|
export let handleQuoteDebugModal = void 0;
|
|
26
|
-
export
|
|
27
|
-
export let colorTheme;
|
|
35
|
+
export let handleDebugTradeModal = void 0;
|
|
28
36
|
export let codeMirrorTheme;
|
|
29
37
|
export let lightweightChartsTheme;
|
|
30
38
|
export let orderbookAddress;
|
|
31
39
|
export let orderHash;
|
|
32
|
-
export let rpcUrl;
|
|
33
|
-
export let subgraphUrl;
|
|
34
40
|
export let chainId;
|
|
35
|
-
export let
|
|
36
|
-
export let
|
|
41
|
+
export let rpcs = void 0;
|
|
42
|
+
export let onRemove;
|
|
43
|
+
export let onDeposit;
|
|
44
|
+
export let onWithdraw;
|
|
45
|
+
export let onWithdrawAll = void 0;
|
|
37
46
|
let codeMirrorDisabled = true;
|
|
38
47
|
let codeMirrorStyles = {};
|
|
39
48
|
const queryClient = useQueryClient();
|
|
49
|
+
const { matchesAccount } = useAccount();
|
|
50
|
+
const { errToast } = useToasts();
|
|
51
|
+
const raindexClient = useRaindexClient();
|
|
40
52
|
$: orderDetailQuery = createQuery({
|
|
41
|
-
queryKey: [
|
|
42
|
-
queryFn: () => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
queryKey: [QKEY_ORDER, orderHash],
|
|
54
|
+
queryFn: async () => {
|
|
55
|
+
const result = await raindexClient.getOrderByHash(chainId, orderbookAddress, orderHash);
|
|
56
|
+
if (result.error) throw new Error(result.error.readableMsg);
|
|
57
|
+
return result.value;
|
|
58
|
+
}
|
|
46
59
|
});
|
|
47
60
|
const interval = setInterval(async () => {
|
|
48
|
-
await
|
|
61
|
+
await invalidateTanstackQueries(queryClient, [orderHash]);
|
|
49
62
|
}, 1e4);
|
|
50
63
|
onDestroy(() => {
|
|
51
64
|
clearInterval(interval);
|
|
52
65
|
});
|
|
53
|
-
|
|
66
|
+
const handleRefresh = async () => {
|
|
67
|
+
try {
|
|
68
|
+
await invalidateTanstackQueries(queryClient, [orderHash]);
|
|
69
|
+
} catch {
|
|
70
|
+
errToast("Failed to refresh");
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const vaultTypesMap = [
|
|
74
|
+
{ key: "Output vaults", type: "output", getter: "outputsList" },
|
|
75
|
+
{ key: "Input vaults", type: "input", getter: "inputsList" },
|
|
76
|
+
{
|
|
77
|
+
key: "Input & output vaults",
|
|
78
|
+
type: "inputOutput",
|
|
79
|
+
getter: "inputsOutputsList"
|
|
80
|
+
}
|
|
81
|
+
];
|
|
82
|
+
const formatGuiState = (guiState) => {
|
|
83
|
+
try {
|
|
84
|
+
return JSON.stringify(JSON.parse(guiState), null, 2);
|
|
85
|
+
} catch {
|
|
86
|
+
return "Invalid GUI state";
|
|
87
|
+
}
|
|
88
|
+
};
|
|
54
89
|
</script>
|
|
55
90
|
|
|
56
91
|
<TanstackPageContentDetail query={orderDetailQuery} emptyMessage="Order not found">
|
|
@@ -61,35 +96,25 @@ $: subgraphName = $page.url.pathname.split("/")[2]?.split("-")[0];
|
|
|
61
96
|
<div class="flex items-center gap-x-2">
|
|
62
97
|
<div class="flex gap-x-2">
|
|
63
98
|
<span class="font-light">Order</span>
|
|
64
|
-
<Hash shorten value={data.
|
|
99
|
+
<Hash shorten value={data.orderHash} />
|
|
65
100
|
</div>
|
|
66
|
-
|
|
67
|
-
<BadgeActive active={data.order.active} large />
|
|
101
|
+
<BadgeActive active={data.active} large />
|
|
68
102
|
</div>
|
|
69
103
|
|
|
70
104
|
<div class="flex items-center gap-2">
|
|
71
|
-
{#if data
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
order: data.order,
|
|
80
|
-
onRemove: $orderDetailQuery.refetch,
|
|
81
|
-
chainId,
|
|
82
|
-
orderbookAddress,
|
|
83
|
-
subgraphUrl
|
|
84
|
-
}
|
|
85
|
-
})}
|
|
86
|
-
disabled={!handleOrderRemoveModal}
|
|
87
|
-
>
|
|
88
|
-
Remove
|
|
89
|
-
</Button>
|
|
105
|
+
{#if matchesAccount(data.owner)}
|
|
106
|
+
{#if data.active}
|
|
107
|
+
<Button
|
|
108
|
+
on:click={() => onRemove(raindexClient, data)}
|
|
109
|
+
data-testid="remove-button"
|
|
110
|
+
aria-label="Remove order">Remove</Button
|
|
111
|
+
>
|
|
112
|
+
{/if}
|
|
90
113
|
{/if}
|
|
114
|
+
|
|
91
115
|
<Refresh
|
|
92
|
-
|
|
116
|
+
testId="top-refresh"
|
|
117
|
+
on:click={handleRefresh}
|
|
93
118
|
spin={$orderDetailQuery.isLoading || $orderDetailQuery.isFetching}
|
|
94
119
|
/>
|
|
95
120
|
</div>
|
|
@@ -100,50 +125,91 @@ $: subgraphName = $page.url.pathname.split("/")[2]?.split("-")[0];
|
|
|
100
125
|
<CardProperty>
|
|
101
126
|
<svelte:fragment slot="key">Orderbook</svelte:fragment>
|
|
102
127
|
<svelte:fragment slot="value">
|
|
103
|
-
<Hash type={HashType.Identifier} shorten={false} value={data.
|
|
128
|
+
<Hash type={HashType.Identifier} shorten={false} value={data.orderbook} />
|
|
104
129
|
</svelte:fragment>
|
|
105
130
|
</CardProperty>
|
|
106
131
|
|
|
107
132
|
<CardProperty>
|
|
108
133
|
<svelte:fragment slot="key">Owner</svelte:fragment>
|
|
109
134
|
<svelte:fragment slot="value">
|
|
110
|
-
|
|
135
|
+
{@const explorerLink = getExplorerLink(data.owner, chainId, 'address')}
|
|
136
|
+
{#if explorerLink}
|
|
137
|
+
<a
|
|
138
|
+
href={explorerLink}
|
|
139
|
+
target="_blank"
|
|
140
|
+
rel="noopener noreferrer"
|
|
141
|
+
class="flex items-center justify-start space-x-2 text-left text-blue-500 hover:underline"
|
|
142
|
+
>
|
|
143
|
+
<WalletOutline size="sm" />
|
|
144
|
+
<span>{data.owner}</span>
|
|
145
|
+
</a>
|
|
146
|
+
{:else}
|
|
147
|
+
<Hash type={HashType.Wallet} shorten={false} value={data.owner} />
|
|
148
|
+
{/if}
|
|
111
149
|
</svelte:fragment>
|
|
112
150
|
</CardProperty>
|
|
113
151
|
|
|
114
152
|
<CardProperty>
|
|
115
153
|
<svelte:fragment slot="key">Created</svelte:fragment>
|
|
116
154
|
<svelte:fragment slot="value">
|
|
117
|
-
{formatTimestampSecondsAsLocal(
|
|
155
|
+
{formatTimestampSecondsAsLocal(data.timestampAdded)}
|
|
118
156
|
</svelte:fragment>
|
|
119
157
|
</CardProperty>
|
|
120
158
|
|
|
121
|
-
{#each
|
|
122
|
-
{
|
|
159
|
+
{#each vaultTypesMap as { key, type, getter }}
|
|
160
|
+
{@const filteredVaults = data.vaultsList.items.filter((vault) => vault.vaultType === type)}
|
|
161
|
+
{@const vaultsListByType = data[getter]}
|
|
162
|
+
{#if filteredVaults.length !== 0}
|
|
123
163
|
<CardProperty>
|
|
124
|
-
<svelte:fragment slot="key"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
164
|
+
<svelte:fragment slot="key">
|
|
165
|
+
<div class="flex items-center justify-between">
|
|
166
|
+
<div class="flex items-center gap-x-2">
|
|
167
|
+
{key}
|
|
168
|
+
{#if type === 'inputOutput'}
|
|
169
|
+
<InfoCircleOutline class="h-4 w-4" /><Tooltip
|
|
170
|
+
>{'These vaults can be an input or an output for this order'}</Tooltip
|
|
171
|
+
>{/if}
|
|
172
|
+
</div>
|
|
173
|
+
{#if onWithdrawAll}
|
|
174
|
+
<Button
|
|
175
|
+
color="light"
|
|
176
|
+
size="xs"
|
|
177
|
+
on:click={() =>
|
|
178
|
+
vaultsListByType && onWithdrawAll(raindexClient, vaultsListByType)}
|
|
179
|
+
disabled={!vaultsListByType ||
|
|
180
|
+
vaultsListByType.getWithdrawableVaults()?.value?.length === 0}
|
|
181
|
+
data-testid="withdraw-all-button"
|
|
182
|
+
>
|
|
183
|
+
<ArrowUpFromBracketOutline size="xs" class="mr-2" />
|
|
184
|
+
Withdraw all
|
|
185
|
+
</Button>
|
|
186
|
+
{/if}
|
|
187
|
+
</div>
|
|
188
|
+
</svelte:fragment>
|
|
133
189
|
<svelte:fragment slot="value">
|
|
134
190
|
<div class="mt-2 space-y-2">
|
|
135
|
-
{#each
|
|
136
|
-
<ButtonVaultLink tokenVault={vault} {
|
|
191
|
+
{#each filteredVaults as vault}
|
|
192
|
+
<ButtonVaultLink tokenVault={vault} {chainId} {orderbookAddress}>
|
|
137
193
|
<svelte:fragment slot="buttons">
|
|
138
|
-
{#if
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
194
|
+
{#if matchesAccount(vault.owner)}
|
|
195
|
+
<div class="flex gap-1">
|
|
196
|
+
<Button
|
|
197
|
+
color="light"
|
|
198
|
+
size="xs"
|
|
199
|
+
data-testid="deposit-button"
|
|
200
|
+
on:click={() => onDeposit(raindexClient, vault)}
|
|
201
|
+
>
|
|
202
|
+
<ArrowDownToBracketOutline size="xs" />
|
|
203
|
+
</Button>
|
|
204
|
+
<Button
|
|
205
|
+
color="light"
|
|
206
|
+
size="xs"
|
|
207
|
+
data-testid="withdraw-button"
|
|
208
|
+
on:click={() => onWithdraw(raindexClient, vault)}
|
|
209
|
+
>
|
|
210
|
+
<ArrowUpFromBracketOutline size="xs" />
|
|
211
|
+
</Button>
|
|
212
|
+
</div>
|
|
147
213
|
{/if}
|
|
148
214
|
</svelte:fragment>
|
|
149
215
|
</ButtonVaultLink>
|
|
@@ -153,42 +219,74 @@ $: subgraphName = $page.url.pathname.split("/")[2]?.split("-")[0];
|
|
|
153
219
|
</CardProperty>
|
|
154
220
|
{/if}
|
|
155
221
|
{/each}
|
|
222
|
+
{#if onWithdrawAll}
|
|
223
|
+
<Button
|
|
224
|
+
size="xs"
|
|
225
|
+
on:click={() =>
|
|
226
|
+
$orderDetailQuery.data?.vaultsList &&
|
|
227
|
+
onWithdrawAll(raindexClient, $orderDetailQuery.data.vaultsList)}
|
|
228
|
+
disabled={!$orderDetailQuery.data?.vaultsList ||
|
|
229
|
+
$orderDetailQuery.data?.vaultsList?.getWithdrawableVaults()?.value?.length === 0}
|
|
230
|
+
data-testid="withdraw-all-button"
|
|
231
|
+
>
|
|
232
|
+
<ArrowUpFromBracketOutline size="xs" class="mr-2" />
|
|
233
|
+
Withdraw all vaults
|
|
234
|
+
</Button>
|
|
235
|
+
{/if}
|
|
156
236
|
</div>
|
|
157
237
|
</svelte:fragment>
|
|
158
238
|
<svelte:fragment slot="chart" let:data>
|
|
159
|
-
<OrderTradesChart
|
|
239
|
+
<OrderTradesChart order={data} {lightweightChartsTheme} />
|
|
160
240
|
</svelte:fragment>
|
|
161
241
|
<svelte:fragment slot="below" let:data>
|
|
162
|
-
<TanstackOrderQuote
|
|
163
|
-
id={data.order.id}
|
|
164
|
-
order={data.order}
|
|
165
|
-
{rpcUrl}
|
|
166
|
-
{orderbookAddress}
|
|
167
|
-
{handleQuoteDebugModal}
|
|
168
|
-
/>
|
|
242
|
+
<TanstackOrderQuote order={data} {handleQuoteDebugModal} />
|
|
169
243
|
<Tabs
|
|
170
244
|
style="underline"
|
|
171
245
|
contentClass="mt-4"
|
|
172
246
|
defaultClass="flex flex-wrap space-x-2 rtl:space-x-reverse mt-4 list-none"
|
|
173
247
|
>
|
|
174
|
-
|
|
248
|
+
{#if data.dotrainSource}
|
|
249
|
+
<TabItem title="Dotrain">
|
|
250
|
+
<div class="mb-8 overflow-hidden rounded-lg border dark:border-none">
|
|
251
|
+
<CodeMirrorRainlang
|
|
252
|
+
rainlangText={data.dotrainSource}
|
|
253
|
+
codeMirrorTheme={$codeMirrorTheme}
|
|
254
|
+
{codeMirrorDisabled}
|
|
255
|
+
{codeMirrorStyles}
|
|
256
|
+
></CodeMirrorRainlang>
|
|
257
|
+
</div>
|
|
258
|
+
</TabItem>
|
|
259
|
+
{/if}
|
|
260
|
+
<TabItem title="On-chain Rainlang">
|
|
175
261
|
<div class="mb-8 overflow-hidden rounded-lg border dark:border-none">
|
|
176
262
|
<CodeMirrorRainlang
|
|
177
|
-
|
|
263
|
+
rainlangText={data.rainlang}
|
|
178
264
|
codeMirrorTheme={$codeMirrorTheme}
|
|
179
265
|
{codeMirrorDisabled}
|
|
180
266
|
{codeMirrorStyles}
|
|
181
267
|
></CodeMirrorRainlang>
|
|
182
268
|
</div>
|
|
183
269
|
</TabItem>
|
|
270
|
+
{#if data.dotrainGuiState}
|
|
271
|
+
<TabItem title="Gui State">
|
|
272
|
+
<div class="mb-4">
|
|
273
|
+
<div class="overflow-auto rounded-lg border bg-gray-50 p-4 dark:bg-gray-800">
|
|
274
|
+
<pre class="text-sm" data-testid="gui-state-json">
|
|
275
|
+
{formatGuiState(data.dotrainGuiState)}
|
|
276
|
+
</pre>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</TabItem>
|
|
280
|
+
{/if}
|
|
184
281
|
<TabItem open title="Trades">
|
|
185
|
-
<OrderTradesListTable
|
|
282
|
+
<OrderTradesListTable order={data} {handleDebugTradeModal} {rpcs} />
|
|
186
283
|
</TabItem>
|
|
187
284
|
<TabItem title="Volume">
|
|
188
|
-
<OrderVaultsVolTable
|
|
285
|
+
<OrderVaultsVolTable order={data} />
|
|
189
286
|
</TabItem>
|
|
190
287
|
<TabItem title="APY">
|
|
191
|
-
<
|
|
288
|
+
<div>TODO: Issue #1989</div>
|
|
289
|
+
<!-- <OrderApy order={data} /> -->
|
|
192
290
|
</TabItem>
|
|
193
291
|
</Tabs>
|
|
194
292
|
</svelte:fragment>
|