@rainlanguage/ui-components 0.0.1-alpha.24 → 0.0.1-alpha.241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/__fixtures__/settings.yaml +123 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte +4 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte.d.ts +18 -0
- package/dist/__mocks__/MockCodeMirrorEditor.svelte +17 -0
- package/dist/__mocks__/MockCodeMirrorEditor.svelte.d.ts +21 -0
- package/dist/__mocks__/MockComponent.js +1 -1
- package/dist/__mocks__/MockComponent.svelte +10 -2
- package/dist/__mocks__/MockComponent.svelte.d.ts +4 -1
- package/dist/__mocks__/mockWeb3Config.d.ts +1 -1
- package/dist/__mocks__/mockWeb3Config.js +10 -7
- package/dist/__mocks__/queries.js +9 -9
- package/dist/__mocks__/stores.d.ts +55 -45
- package/dist/__mocks__/stores.js +85 -68
- package/dist/app.css +3 -3
- package/dist/components/ButtonDarkMode.svelte +7 -1
- package/dist/components/ButtonLoading.svelte +1 -1
- package/dist/components/ButtonScrub.svelte +22 -0
- package/dist/components/ButtonScrub.svelte.d.ts +25 -0
- package/dist/components/ButtonVaultLink.svelte +12 -11
- package/dist/components/ButtonVaultLink.svelte.d.ts +4 -3
- package/dist/components/CheckboxInactiveOrdersVault.svelte +20 -0
- package/dist/components/CheckboxInactiveOrdersVault.svelte.d.ts +19 -0
- package/dist/components/CheckboxZeroBalanceVault.svelte.d.ts +2 -2
- package/dist/components/CodeMirrorDotrain.svelte +4 -0
- package/dist/components/CodeMirrorDotrain.svelte.d.ts +1 -0
- package/dist/components/CodeMirrorRainlang.svelte +20 -12
- package/dist/components/CodeMirrorRainlang.svelte.d.ts +3 -2
- package/dist/components/EditableSpan.svelte +3 -14
- package/dist/components/EditableSpan.svelte.d.ts +0 -1
- package/dist/components/Hash.svelte +6 -5
- package/dist/components/License.svelte +5 -4
- package/dist/components/ListViewRaindexFilters.svelte +64 -0
- package/dist/components/ListViewRaindexFilters.svelte.d.ts +32 -0
- package/dist/components/LocalDbStatusBadge.svelte +27 -0
- package/dist/components/LocalDbStatusBadge.svelte.d.ts +19 -0
- package/dist/components/LocalDbStatusCard.svelte +43 -0
- package/dist/components/LocalDbStatusCard.svelte.d.ts +20 -0
- package/dist/components/LocalDbStatusModal.svelte +105 -0
- package/dist/components/LocalDbStatusModal.svelte.d.ts +21 -0
- package/dist/components/OrderOrVaultHash.svelte +12 -12
- package/dist/components/OrderOrVaultHash.svelte.d.ts +4 -4
- package/dist/components/PageHeader.svelte +1 -1
- package/dist/components/Sensitive.svelte +16 -0
- package/dist/components/Sensitive.svelte.d.ts +28 -0
- package/dist/components/TanstackAppTable.svelte +270 -60
- package/dist/components/TanstackAppTable.svelte.d.ts +15 -9
- package/dist/components/ToastDetail.svelte +42 -0
- package/dist/components/ToastDetail.svelte.d.ts +20 -0
- package/dist/components/Tooltip.svelte +8 -0
- package/dist/components/Tooltip.svelte.d.ts +21 -0
- package/dist/components/VaultBalanceChangeTypeFilter.svelte +23 -0
- package/dist/components/VaultBalanceChangeTypeFilter.svelte.d.ts +19 -0
- package/dist/components/VaultCard.svelte +18 -0
- package/dist/components/VaultCard.svelte.d.ts +19 -0
- package/dist/components/charts/LightweightChart.svelte +1 -1
- package/dist/components/charts/LightweightChart.svelte.d.ts +5 -5
- package/dist/components/charts/OrderTradesChart.svelte +319 -28
- package/dist/components/charts/OrderTradesChart.svelte.d.ts +4 -4
- package/dist/components/charts/TanstackLightweightChartLine.svelte +5 -9
- package/dist/components/charts/VaultBalanceChart.svelte +8 -26
- package/dist/components/charts/VaultBalanceChart.svelte.d.ts +1 -7
- package/dist/components/charts/transformAndSortData.d.ts +24 -0
- package/dist/components/charts/transformAndSortData.js +111 -0
- package/dist/components/checkbox/CheckboxActiveOrders.svelte +11 -0
- package/dist/components/checkbox/CheckboxActiveOrders.svelte.d.ts +19 -0
- package/dist/components/deployment/ButtonSelectOption.svelte +2 -0
- package/dist/components/deployment/ButtonSelectOption.svelte.d.ts +1 -0
- package/dist/components/deployment/ComposedRainlangModal.svelte +3 -2
- package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +1 -4
- package/dist/components/deployment/DeploymentSectionHeader.svelte +7 -4
- package/dist/components/deployment/DeploymentSteps.svelte +196 -221
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +6 -12
- package/dist/components/deployment/DeploymentTile.svelte +2 -2
- package/dist/components/deployment/DeploymentTile.svelte.d.ts +1 -1
- package/dist/components/deployment/DeploymentsSection.svelte +15 -22
- package/dist/components/deployment/DeploymentsSection.svelte.d.ts +3 -2
- package/dist/components/deployment/DepositInput.svelte +10 -11
- package/dist/components/deployment/DepositInput.svelte.d.ts +2 -3
- package/dist/components/deployment/DisclaimerModal.svelte +6 -7
- package/dist/components/deployment/FieldDefinitionInput.svelte +10 -14
- package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +2 -3
- package/dist/components/deployment/InvalidOrdersSection.svelte +17 -0
- package/dist/components/deployment/InvalidOrdersSection.svelte.d.ts +19 -0
- package/dist/components/deployment/{StrategyPage.svelte → OrderPage.svelte} +15 -24
- package/dist/components/deployment/OrderPage.svelte.d.ts +21 -0
- package/dist/components/deployment/SelectToken.svelte +127 -50
- package/dist/components/deployment/SelectToken.svelte.d.ts +5 -4
- package/dist/components/deployment/TokenBalance.svelte +19 -0
- package/dist/components/deployment/TokenBalance.svelte.d.ts +19 -0
- package/dist/components/deployment/TokenIOInput.svelte +27 -17
- package/dist/components/deployment/TokenIOInput.svelte.d.ts +3 -3
- package/dist/components/deployment/TokenSelectionModal.svelte +148 -0
- package/dist/components/deployment/TokenSelectionModal.svelte.d.ts +20 -0
- package/dist/components/deployment/{ValidStrategiesSection.svelte → ValidOrdersSection.svelte} +7 -7
- package/dist/components/deployment/ValidOrdersSection.svelte.d.ts +19 -0
- package/dist/components/deployment/VaultIdInformation.svelte +17 -0
- package/dist/components/deployment/VaultIdInformation.svelte.d.ts +21 -0
- package/dist/components/detail/OrderDetail.svelte +220 -82
- package/dist/components/detail/OrderDetail.svelte.d.ts +21 -15
- package/dist/components/detail/TanstackOrderQuote.svelte +114 -46
- package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +14 -16
- package/dist/components/detail/VaultDetail.svelte +82 -79
- package/dist/components/detail/VaultDetail.svelte.d.ts +12 -18
- package/dist/components/dropdown/DropdownActiveNetworks.svelte +44 -0
- package/dist/components/dropdown/DropdownActiveNetworks.svelte.d.ts +19 -0
- package/dist/components/dropdown/DropdownCheckbox.svelte +4 -4
- package/dist/components/dropdown/DropdownRaindexesFilter.svelte +172 -0
- package/dist/components/dropdown/DropdownRaindexesFilter.svelte.d.ts +25 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte +152 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte.d.ts +28 -0
- package/dist/components/icon/Refresh.svelte +4 -2
- package/dist/components/icon/Refresh.svelte.d.ts +2 -0
- package/dist/components/input/InputOrderHash.svelte +1 -1
- package/dist/components/input/InputOrderHash.svelte.d.ts +3 -3
- package/dist/components/input/InputOwnerFilter.svelte +48 -0
- package/dist/components/input/InputOwnerFilter.svelte.d.ts +19 -0
- package/dist/components/input/InputRegistryUrl.svelte +36 -14
- package/dist/components/input/InputToken.svelte +2 -2
- package/dist/components/input/InputTokenAmount.svelte +30 -20
- package/dist/components/input/InputTokenAmount.svelte.d.ts +3 -3
- package/dist/components/tables/OrderAPY.svelte +6 -33
- package/dist/components/tables/OrderAPY.svelte.d.ts +1 -4
- package/dist/components/tables/OrderTradesListTable.svelte +132 -124
- package/dist/components/tables/OrderTradesListTable.svelte.d.ts +4 -4
- package/dist/components/tables/OrderVaultsVolTable.svelte +17 -22
- package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +2 -2
- package/dist/components/tables/OrdersListTable.svelte +206 -115
- package/dist/components/tables/OrdersListTable.svelte.d.ts +18 -23
- package/dist/components/tables/VaultBalanceChangesTable.svelte +83 -43
- package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +13 -11
- package/dist/components/tables/VaultsListTable.svelte +275 -150
- package/dist/components/tables/VaultsListTable.svelte.d.ts +24 -33
- package/dist/components/transactions/FixedBottomTransaction.svelte +64 -0
- package/dist/components/transactions/FixedBottomTransaction.svelte.d.ts +16 -0
- package/dist/components/transactions/TransactionDetail.svelte +31 -0
- package/dist/components/transactions/TransactionDetail.svelte.d.ts +20 -0
- package/dist/components/transactions/TransactionList.svelte +17 -0
- package/dist/components/transactions/TransactionList.svelte.d.ts +16 -0
- package/dist/components/transactions/getStatusEmoji.d.ts +2 -0
- package/dist/components/transactions/getStatusEmoji.js +20 -0
- package/dist/components/wallet/WalletConnect.svelte +5 -4
- package/dist/components/wallet/WalletConnect.svelte.d.ts +0 -1
- package/dist/consts.d.ts +1 -0
- package/dist/consts.js +1 -0
- package/dist/errors/DeploymentStepsError.d.ts +11 -5
- package/dist/errors/DeploymentStepsError.js +13 -7
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/hooks/useLocalDb.d.ts +3 -0
- package/dist/hooks/useLocalDb.js +10 -0
- package/dist/hooks/useRaindexClient.d.ts +3 -0
- package/dist/hooks/useRaindexClient.js +11 -0
- package/dist/hooks/useRaindexOrderBuilder.d.ts +3 -0
- package/dist/hooks/useRaindexOrderBuilder.js +11 -0
- package/dist/index.d.ts +122 -91
- package/dist/index.js +118 -87
- package/dist/models/Transaction.d.ts +75 -0
- package/dist/models/Transaction.js +100 -0
- package/dist/providers/LocalDbProvider.svelte +8 -0
- package/dist/providers/LocalDbProvider.svelte.d.ts +21 -0
- package/dist/providers/RaindexClientProvider.svelte +8 -0
- package/dist/providers/RaindexClientProvider.svelte.d.ts +21 -0
- package/dist/providers/RaindexOrderBuilderProvider.svelte +8 -0
- package/dist/providers/RaindexOrderBuilderProvider.svelte.d.ts +21 -0
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte +8 -0
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte.d.ts +24 -0
- package/dist/providers/dotrainRegistry/context.d.ts +9 -0
- package/dist/providers/dotrainRegistry/context.js +43 -0
- package/dist/providers/dotrainRegistry/useDotrainRegistry.d.ts +5 -0
- package/dist/providers/dotrainRegistry/useDotrainRegistry.js +35 -0
- package/dist/providers/registry/RegistryManager.d.ts +65 -0
- package/dist/providers/registry/RegistryManager.js +134 -0
- package/dist/providers/registry/RegistryProvider.svelte +6 -0
- package/dist/providers/registry/RegistryProvider.svelte.d.ts +21 -0
- package/dist/providers/registry/context.d.ts +10 -0
- package/dist/providers/registry/context.js +46 -0
- package/dist/providers/registry/useRegistry.d.ts +7 -0
- package/dist/providers/registry/useRegistry.js +29 -0
- package/dist/providers/toasts/ToastProvider.svelte +17 -0
- package/dist/providers/toasts/ToastProvider.svelte.d.ts +18 -0
- package/dist/providers/toasts/context.d.ts +14 -0
- package/dist/providers/toasts/context.js +22 -0
- package/dist/providers/toasts/useToasts.d.ts +16 -0
- package/dist/providers/toasts/useToasts.js +63 -0
- package/dist/providers/transactions/TransactionManager.d.ts +234 -0
- package/dist/providers/transactions/TransactionManager.js +509 -0
- package/dist/providers/transactions/TransactionProvider.svelte +11 -0
- package/dist/providers/transactions/TransactionProvider.svelte.d.ts +24 -0
- package/dist/providers/transactions/context.d.ts +19 -0
- package/dist/providers/transactions/context.js +28 -0
- package/dist/providers/transactions/useTransactions.d.ts +13 -0
- package/dist/providers/transactions/useTransactions.js +18 -0
- package/dist/providers/wallet/WalletProvider.svelte +7 -0
- package/dist/providers/wallet/WalletProvider.svelte.d.ts +21 -0
- package/dist/providers/wallet/context.d.ts +10 -0
- package/dist/providers/wallet/context.js +47 -0
- package/dist/providers/wallet/useAccount.d.ts +8 -0
- package/dist/providers/wallet/useAccount.js +148 -0
- package/dist/queries/keys.d.ts +1 -0
- package/dist/queries/keys.js +10 -9
- package/dist/queries/queryClient.d.ts +2 -2
- package/dist/queries/queryClient.js +16 -11
- package/dist/services/awaitTransactionIndexing.d.ts +107 -0
- package/dist/services/awaitTransactionIndexing.js +60 -0
- package/dist/services/getExplorerLink.d.ts +1 -1
- package/dist/services/getExplorerLink.js +3 -5
- package/dist/services/handleShareChoices.d.ts +2 -2
- package/dist/services/handleShareChoices.js +6 -5
- package/dist/services/historicalOrderCharts.d.ts +3 -3
- package/dist/services/historicalOrderCharts.js +364 -371
- package/dist/services/index.d.ts +5 -2
- package/dist/services/index.js +3 -1
- package/dist/services/loadRegistryUrl.d.ts +2 -0
- package/dist/services/loadRegistryUrl.js +22 -0
- package/dist/services/pairTradesChartData.d.ts +47 -0
- package/dist/services/pairTradesChartData.js +194 -0
- package/dist/services/registry.d.ts +5 -5
- package/dist/services/registry.js +17 -217
- package/dist/services/time.d.ts +12 -0
- package/dist/services/time.js +88 -6
- package/dist/services/validateAmount.d.ts +30 -0
- package/dist/services/validateAmount.js +53 -0
- package/dist/storesGeneric/cachedWritableStore.d.ts +57 -0
- package/dist/storesGeneric/cachedWritableStore.js +93 -0
- package/dist/storesGeneric/scrub.d.ts +14 -0
- package/dist/storesGeneric/scrub.js +22 -0
- package/dist/test/matchers.d.ts +2 -2
- package/dist/test/matchers.js +2 -2
- package/dist/types/account.d.ts +3 -0
- package/dist/types/appStores.d.ts +9 -16
- package/dist/types/modal.d.ts +26 -14
- package/dist/types/order.d.ts +10 -0
- package/dist/types/order.js +1 -0
- package/dist/types/toast.d.ts +11 -0
- package/dist/types/toast.js +1 -0
- package/dist/types/tokenBalance.d.ts +6 -0
- package/dist/types/tokenBalance.js +1 -0
- package/dist/types/transaction.d.ts +67 -22
- package/dist/types/transaction.js +31 -1
- package/dist/utils/breadcrumbs.js +2 -2
- package/dist/utils/codeMirrorThemes.js +80 -74
- package/dist/utils/configHelpers.d.ts +4 -0
- package/dist/utils/configHelpers.js +21 -0
- package/dist/utils/constructHashLink.d.ts +24 -0
- package/dist/utils/constructHashLink.js +117 -0
- package/dist/utils/getNetworkName.d.ts +1 -0
- package/dist/utils/getNetworkName.js +13 -0
- package/dist/utils/hex.js +1 -1
- package/dist/utils/lightweightChartsThemes.d.ts +1 -1
- package/dist/utils/lightweightChartsThemes.js +11 -11
- package/dist/utils/localDbStatus.d.ts +26 -0
- package/dist/utils/localDbStatus.js +22 -0
- package/dist/utils/number.d.ts +0 -7
- package/dist/utils/number.js +5 -30
- package/dist/utils/stripTrailingWhitespace.d.ts +16 -0
- package/dist/utils/stripTrailingWhitespace.js +22 -0
- package/dist/utils/tokens.d.ts +2 -0
- package/dist/utils/tokens.js +3 -0
- package/dist/utils/vaultBalanceChangeLabels.d.ts +4 -0
- package/dist/utils/vaultBalanceChangeLabels.js +18 -0
- package/package.json +89 -84
- package/dist/__fixtures__/orderDetail.d.ts +0 -99
- package/dist/__fixtures__/orderDetail.js +0 -204
- package/dist/__fixtures__/settings-12-11-24.json +0 -160
- package/dist/__mocks__/mockTransactionStore.d.ts +0 -22
- package/dist/__mocks__/mockTransactionStore.js +0 -56
- package/dist/__mocks__/settings.d.ts +0 -3
- package/dist/__mocks__/settings.js +0 -37
- package/dist/components/CheckboxMyItemsOnly.svelte +0 -23
- package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +0 -21
- package/dist/components/ListViewOrderbookFilters.svelte +0 -58
- package/dist/components/ListViewOrderbookFilters.svelte.d.ts +0 -28
- package/dist/components/deployment/InvalidStrategiesSection.svelte +0 -19
- package/dist/components/deployment/InvalidStrategiesSection.svelte.d.ts +0 -19
- package/dist/components/deployment/StrategyPage.svelte.d.ts +0 -19
- package/dist/components/deployment/ValidStrategiesSection.svelte.d.ts +0 -19
- package/dist/components/deployment/getDeploymentTransactionArgs.d.ts +0 -17
- package/dist/components/deployment/getDeploymentTransactionArgs.js +0 -28
- package/dist/components/detail/DepositOrWithdrawButtons.svelte +0 -44
- package/dist/components/detail/DepositOrWithdrawButtons.svelte.d.ts +0 -26
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte +0 -38
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte.d.ts +0 -21
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte +0 -15
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +0 -20
- package/dist/components/dropdown/DropdownOrderStatus.svelte +0 -31
- package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +0 -19
- package/dist/hooks/useGui.d.ts +0 -3
- package/dist/hooks/useGui.js +0 -11
- package/dist/providers/GuiProvider.svelte +0 -8
- package/dist/providers/GuiProvider.svelte.d.ts +0 -21
- package/dist/stores/transactionStore.d.ts +0 -98
- package/dist/stores/transactionStore.js +0 -303
- package/dist/types/strategy.d.ts +0 -10
- package/dist/utils/time.d.ts +0 -12
- package/dist/utils/time.js +0 -27
- package/dist/utils/vault.d.ts +0 -2
- package/dist/utils/vault.js +0 -29
- /package/dist/types/{strategy.js → account.js} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script>import Markdown from "svelte-markdown";
|
|
2
|
+
export let title;
|
|
2
3
|
export let description = "";
|
|
3
4
|
</script>
|
|
4
5
|
|
|
@@ -7,8 +8,10 @@ export let description = "";
|
|
|
7
8
|
{title}
|
|
8
9
|
</h1>
|
|
9
10
|
{#if description}
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
<div
|
|
12
|
+
class="prose prose-sm lg:prose-base prose-neutral dark:prose-invert text-gray-600 dark:text-gray-400"
|
|
13
|
+
>
|
|
14
|
+
<Markdown source={description} />
|
|
15
|
+
</div>
|
|
13
16
|
{/if}
|
|
14
17
|
</div>
|
|
@@ -1,209 +1,175 @@
|
|
|
1
|
-
<script>import { Alert } from "flowbite-svelte";
|
|
1
|
+
<script>import { Alert, Button, Spinner, Toggle } from "flowbite-svelte";
|
|
2
2
|
import TokenIOInput from "./TokenIOInput.svelte";
|
|
3
3
|
import ComposedRainlangModal from "./ComposedRainlangModal.svelte";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
RaindexOrderBuilder,
|
|
6
|
+
RaindexClient,
|
|
7
|
+
AccountBalance,
|
|
8
|
+
Float
|
|
9
|
+
} from "@rainlanguage/raindex";
|
|
6
10
|
import WalletConnect from "../wallet/WalletConnect.svelte";
|
|
7
|
-
import {
|
|
8
|
-
} from "@rainlanguage/orderbook/js_api";
|
|
9
|
-
import { fade } from "svelte/transition";
|
|
10
|
-
import { Button, Toggle, Spinner } from "flowbite-svelte";
|
|
11
|
-
import {} from "@wagmi/core";
|
|
12
11
|
import {} from "svelte/store";
|
|
13
|
-
import ShareChoicesButton from "./ShareChoicesButton.svelte";
|
|
14
12
|
import { handleShareChoices } from "../../services/handleShareChoices";
|
|
15
|
-
import { getDeploymentTransactionArgs } from "./getDeploymentTransactionArgs";
|
|
16
13
|
import { DeploymentStepsError, DeploymentStepsErrorCode } from "../../errors";
|
|
17
|
-
import { onMount } from "svelte";
|
|
14
|
+
import { onDestroy, onMount } from "svelte";
|
|
18
15
|
import FieldDefinitionInput from "./FieldDefinitionInput.svelte";
|
|
19
16
|
import DepositInput from "./DepositInput.svelte";
|
|
20
17
|
import SelectToken from "./SelectToken.svelte";
|
|
21
18
|
import DeploymentSectionHeader from "./DeploymentSectionHeader.svelte";
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
import { useRaindexOrderBuilder } from "../../hooks/useRaindexOrderBuilder";
|
|
20
|
+
import { fade } from "svelte/transition";
|
|
21
|
+
import ShareChoicesButton from "./ShareChoicesButton.svelte";
|
|
22
|
+
import { useRegistry } from "../../providers/registry/useRegistry";
|
|
23
|
+
import { useRaindexClient } from "../../hooks/useRaindexClient";
|
|
25
24
|
export let deployment;
|
|
26
|
-
export let
|
|
27
|
-
export let
|
|
28
|
-
export let
|
|
25
|
+
export let orderDetail;
|
|
26
|
+
export let onDeploy;
|
|
27
|
+
export let wagmiConnected;
|
|
28
|
+
export let appKitModal;
|
|
29
|
+
export let account;
|
|
29
30
|
let allDepositFields = [];
|
|
30
31
|
let allTokenOutputs = [];
|
|
32
|
+
let allTokenInputs = [];
|
|
31
33
|
let allFieldDefinitionsWithoutDefaults = [];
|
|
32
34
|
let allFieldDefinitionsWithDefaults = [];
|
|
33
35
|
let allTokensSelected = false;
|
|
34
36
|
let showAdvancedOptions = false;
|
|
35
|
-
let checkingDeployment = false;
|
|
36
37
|
let allTokenInfos = [];
|
|
37
|
-
const gui = useGui();
|
|
38
38
|
let selectTokens = void 0;
|
|
39
|
-
let
|
|
40
|
-
|
|
39
|
+
let checkingDeployment = false;
|
|
40
|
+
let tokenBalances = /* @__PURE__ */ new Map();
|
|
41
|
+
const builder = useRaindexOrderBuilder();
|
|
42
|
+
const registry = useRegistry();
|
|
43
|
+
const raindexClient = useRaindexClient();
|
|
41
44
|
let deploymentStepsError = DeploymentStepsError.error;
|
|
42
|
-
export let wagmiConfig;
|
|
43
|
-
export let wagmiConnected;
|
|
44
|
-
export let appKitModal;
|
|
45
|
-
export let signerAddress;
|
|
46
45
|
onMount(async () => {
|
|
47
|
-
const selectTokensResult =
|
|
46
|
+
const selectTokensResult = builder.getSelectTokens();
|
|
48
47
|
if (selectTokensResult.error) {
|
|
49
48
|
throw new Error(selectTokensResult.error.msg);
|
|
50
49
|
}
|
|
51
50
|
selectTokens = selectTokensResult.value;
|
|
52
|
-
const networkKeyResult = gui.getNetworkKey();
|
|
53
|
-
if (networkKeyResult.error) {
|
|
54
|
-
throw new Error(networkKeyResult.error.msg);
|
|
55
|
-
}
|
|
56
|
-
networkKey = networkKeyResult.value;
|
|
57
51
|
await areAllTokensSelected();
|
|
58
52
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const allFieldDefinitionsResult = gui.getAllFieldDefinitions(false);
|
|
62
|
-
if (allFieldDefinitionsResult.error) {
|
|
63
|
-
throw new Error(allFieldDefinitionsResult.error.msg);
|
|
64
|
-
}
|
|
65
|
-
allFieldDefinitionsWithoutDefaults = allFieldDefinitionsResult.value;
|
|
66
|
-
const allFieldDefinitionsWithDefaultsResult = gui.getAllFieldDefinitions(true);
|
|
67
|
-
if (allFieldDefinitionsWithDefaultsResult.error) {
|
|
68
|
-
throw new Error(allFieldDefinitionsWithDefaultsResult.error.msg);
|
|
69
|
-
}
|
|
70
|
-
allFieldDefinitionsWithDefaults = allFieldDefinitionsWithDefaultsResult.value;
|
|
71
|
-
} catch (e) {
|
|
72
|
-
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.NO_FIELD_DEFINITIONS);
|
|
73
|
-
}
|
|
53
|
+
$: if (selectTokens?.length === 0 || allTokensSelected) {
|
|
54
|
+
updateFields();
|
|
74
55
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
let depositFields = result.value.deposits;
|
|
82
|
-
allDepositFields = depositFields;
|
|
83
|
-
} catch (e) {
|
|
84
|
-
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.NO_DEPOSITS);
|
|
56
|
+
let unsubscribeAccount = account.subscribe((account2) => {
|
|
57
|
+
if (!account2) {
|
|
58
|
+
const balances = tokenBalances;
|
|
59
|
+
balances.clear();
|
|
60
|
+
tokenBalances = balances;
|
|
61
|
+
return;
|
|
85
62
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
let result = gui.getCurrentDeployment();
|
|
91
|
-
if (result.error) {
|
|
92
|
-
throw new Error(result.error.msg);
|
|
93
|
-
}
|
|
94
|
-
allTokenInputs = result.value.deployment.order.inputs;
|
|
95
|
-
} catch (e) {
|
|
96
|
-
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.NO_TOKEN_INPUTS);
|
|
63
|
+
if (selectTokens) {
|
|
64
|
+
selectTokens.forEach(async (selectToken) => {
|
|
65
|
+
await getTokenInfoAndFetchBalance(selectToken.key);
|
|
66
|
+
});
|
|
97
67
|
}
|
|
98
|
-
}
|
|
99
|
-
|
|
68
|
+
});
|
|
69
|
+
onDestroy(() => {
|
|
70
|
+
unsubscribeAccount();
|
|
71
|
+
});
|
|
72
|
+
function getAllBuilderConfig() {
|
|
100
73
|
try {
|
|
101
|
-
let result =
|
|
74
|
+
let result = builder.getAllBuilderConfig();
|
|
102
75
|
if (result.error) {
|
|
103
76
|
throw new Error(result.error.msg);
|
|
104
77
|
}
|
|
105
|
-
|
|
78
|
+
allFieldDefinitionsWithoutDefaults = result.value.fieldDefinitionsWithoutDefaults;
|
|
79
|
+
allFieldDefinitionsWithDefaults = result.value.fieldDefinitionsWithDefaults;
|
|
80
|
+
allDepositFields = result.value.deposits;
|
|
81
|
+
allTokenOutputs = result.value.orderOutputs;
|
|
82
|
+
allTokenInputs = result.value.orderInputs;
|
|
106
83
|
} catch (e) {
|
|
107
|
-
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.
|
|
84
|
+
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.NO_BUILDER_CONFIG);
|
|
108
85
|
}
|
|
109
86
|
}
|
|
110
|
-
|
|
111
|
-
updateFields();
|
|
112
|
-
}
|
|
113
|
-
async function updateFields() {
|
|
87
|
+
function updateFields() {
|
|
114
88
|
try {
|
|
115
89
|
DeploymentStepsError.clear();
|
|
116
|
-
|
|
117
|
-
getAllFieldDefinitions();
|
|
118
|
-
getAllTokenInputs();
|
|
119
|
-
getAllTokenOutputs();
|
|
90
|
+
getAllBuilderConfig();
|
|
120
91
|
} catch (e) {
|
|
121
|
-
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.
|
|
92
|
+
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.NO_BUILDER);
|
|
122
93
|
}
|
|
123
94
|
}
|
|
124
95
|
async function _handleShareChoices() {
|
|
125
|
-
await handleShareChoices(
|
|
96
|
+
await handleShareChoices(builder, registry.getCurrentRegistry());
|
|
97
|
+
}
|
|
98
|
+
async function fetchTokenBalance(tokenInfo) {
|
|
99
|
+
if (!$account) return;
|
|
100
|
+
const balances = tokenBalances;
|
|
101
|
+
balances.set(tokenInfo.key, {
|
|
102
|
+
value: { balance: Float.parse("0").value, formattedBalance: "0" },
|
|
103
|
+
loading: true,
|
|
104
|
+
error: ""
|
|
105
|
+
});
|
|
106
|
+
const { value: accountBalance, error } = await builder.getAccountBalance(
|
|
107
|
+
tokenInfo.address,
|
|
108
|
+
$account
|
|
109
|
+
);
|
|
110
|
+
if (error) {
|
|
111
|
+
balances.set(tokenInfo.key, {
|
|
112
|
+
value: { balance: Float.parse("0").value, formattedBalance: "0" },
|
|
113
|
+
loading: false,
|
|
114
|
+
error: error.readableMsg
|
|
115
|
+
});
|
|
116
|
+
tokenBalances = balances;
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
balances.set(tokenInfo.key, {
|
|
120
|
+
value: accountBalance,
|
|
121
|
+
loading: false,
|
|
122
|
+
error: ""
|
|
123
|
+
});
|
|
124
|
+
tokenBalances = balances;
|
|
125
|
+
}
|
|
126
|
+
async function getTokenInfoAndFetchBalance(key) {
|
|
127
|
+
const tokenInfoResult = await builder.getTokenInfo(key);
|
|
128
|
+
if (tokenInfoResult.error) {
|
|
129
|
+
const balances = tokenBalances;
|
|
130
|
+
balances.delete(key);
|
|
131
|
+
tokenBalances = balances;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const tokenInfo = tokenInfoResult.value;
|
|
135
|
+
if (!tokenInfo || !tokenInfo.address) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
await fetchTokenBalance(tokenInfo);
|
|
126
139
|
}
|
|
127
|
-
async function onSelectTokenSelect() {
|
|
140
|
+
async function onSelectTokenSelect(key) {
|
|
128
141
|
await areAllTokensSelected();
|
|
142
|
+
await getTokenInfoAndFetchBalance(key);
|
|
129
143
|
if (allTokensSelected) {
|
|
130
|
-
let result = await
|
|
144
|
+
let result = await builder.getAllTokenInfos();
|
|
131
145
|
if (result.error) {
|
|
132
146
|
throw new Error(result.error.msg);
|
|
133
147
|
}
|
|
134
148
|
let newAllTokenInfos = result.value;
|
|
135
149
|
if (allTokenInfos !== newAllTokenInfos) {
|
|
136
150
|
allTokenInfos = newAllTokenInfos;
|
|
137
|
-
|
|
138
|
-
getAllFieldDefinitions();
|
|
151
|
+
getAllBuilderConfig();
|
|
139
152
|
}
|
|
140
153
|
}
|
|
141
154
|
}
|
|
142
|
-
async function handleDeployButtonClick() {
|
|
143
|
-
DeploymentStepsError.clear();
|
|
144
|
-
if (!allTokenOutputs) {
|
|
145
|
-
DeploymentStepsError.catch(null, DeploymentStepsErrorCode.NO_TOKEN_OUTPUTS);
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
if (!wagmiConfig) {
|
|
149
|
-
DeploymentStepsError.catch(null, DeploymentStepsErrorCode.NO_CHAIN);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
if (!networkKey) {
|
|
153
|
-
DeploymentStepsError.catch(null, DeploymentStepsErrorCode.NO_CHAIN);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
let result = null;
|
|
157
|
-
checkingDeployment = true;
|
|
158
|
-
try {
|
|
159
|
-
result = await getDeploymentTransactionArgs(gui, $wagmiConfig);
|
|
160
|
-
} catch (e) {
|
|
161
|
-
checkingDeployment = false;
|
|
162
|
-
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.ADD_ORDER_FAILED);
|
|
163
|
-
}
|
|
164
|
-
if (!result) {
|
|
165
|
-
checkingDeployment = false;
|
|
166
|
-
DeploymentStepsError.catch(null, DeploymentStepsErrorCode.ADD_ORDER_FAILED);
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
checkingDeployment = false;
|
|
170
|
-
const onAccept = () => {
|
|
171
|
-
if (!networkKey) {
|
|
172
|
-
DeploymentStepsError.catch(null, DeploymentStepsErrorCode.NO_CHAIN);
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
handleDeployModal({
|
|
176
|
-
open: true,
|
|
177
|
-
args: {
|
|
178
|
-
...result,
|
|
179
|
-
subgraphUrl,
|
|
180
|
-
network: networkKey
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
handleDisclaimerModal({
|
|
185
|
-
open: true,
|
|
186
|
-
onAccept
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
155
|
const areAllTokensSelected = async () => {
|
|
190
156
|
try {
|
|
191
|
-
const areAllTokensSelectedResult =
|
|
157
|
+
const areAllTokensSelectedResult = builder.areAllTokensSelected();
|
|
192
158
|
if (areAllTokensSelectedResult.error) {
|
|
193
159
|
throw new Error(areAllTokensSelectedResult.error.msg);
|
|
194
160
|
}
|
|
195
161
|
allTokensSelected = areAllTokensSelectedResult.value;
|
|
196
162
|
if (!allTokensSelected) return;
|
|
197
|
-
const getAllTokenInfosResult = await
|
|
163
|
+
const getAllTokenInfosResult = await builder.getAllTokenInfos();
|
|
198
164
|
if (getAllTokenInfosResult.error) {
|
|
199
165
|
throw new Error(getAllTokenInfosResult.error.msg);
|
|
200
166
|
}
|
|
201
167
|
allTokenInfos = getAllTokenInfosResult.value;
|
|
202
|
-
const hasDepositsResult =
|
|
168
|
+
const hasDepositsResult = builder.hasAnyDeposit();
|
|
203
169
|
if (hasDepositsResult.error) {
|
|
204
170
|
throw new Error(hasDepositsResult.error.msg);
|
|
205
171
|
}
|
|
206
|
-
const hasVaultIdsResult =
|
|
172
|
+
const hasVaultIdsResult = builder.hasAnyVaultId();
|
|
207
173
|
if (hasVaultIdsResult.error) {
|
|
208
174
|
throw new Error(hasVaultIdsResult.error.msg);
|
|
209
175
|
}
|
|
@@ -214,105 +180,114 @@ const areAllTokensSelected = async () => {
|
|
|
214
180
|
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.NO_SELECT_TOKENS);
|
|
215
181
|
}
|
|
216
182
|
};
|
|
183
|
+
async function handleDeployButtonClick() {
|
|
184
|
+
if (checkingDeployment) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
checkingDeployment = true;
|
|
188
|
+
try {
|
|
189
|
+
if (!$account) {
|
|
190
|
+
DeploymentStepsError.catch(
|
|
191
|
+
"No wallet connected",
|
|
192
|
+
DeploymentStepsErrorCode.ADD_ORDER_FAILED
|
|
193
|
+
);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
DeploymentStepsError.clear();
|
|
197
|
+
return onDeploy(raindexClient, builder);
|
|
198
|
+
} catch (e) {
|
|
199
|
+
DeploymentStepsError.catch(e, DeploymentStepsErrorCode.ADD_ORDER_FAILED);
|
|
200
|
+
} finally {
|
|
201
|
+
checkingDeployment = false;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
217
204
|
</script>
|
|
218
205
|
|
|
219
206
|
<div>
|
|
220
|
-
{#if
|
|
221
|
-
<
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
207
|
+
{#if builder}
|
|
208
|
+
<div class="flex max-w-3xl flex-col gap-12" in:fade>
|
|
209
|
+
{#if deployment}
|
|
210
|
+
<div class="flex max-w-2xl flex-col gap-4 text-start">
|
|
211
|
+
<h1 class="text-4xl font-semibold text-gray-900 lg:text-6xl dark:text-white">
|
|
212
|
+
{orderDetail.name}
|
|
213
|
+
</h1>
|
|
214
|
+
<p class="text-xl text-gray-600 lg:text-2xl dark:text-gray-400">
|
|
215
|
+
{deployment.description}
|
|
216
|
+
</p>
|
|
217
|
+
</div>
|
|
225
218
|
{/if}
|
|
226
|
-
</Alert>
|
|
227
|
-
{/if}
|
|
228
|
-
{#if dotrain}
|
|
229
|
-
{#if gui}
|
|
230
|
-
<div class="flex max-w-3xl flex-col gap-12" in:fade>
|
|
231
|
-
{#if deployment}
|
|
232
|
-
<div class="flex max-w-2xl flex-col gap-4 text-start">
|
|
233
|
-
<h1 class=" text-4xl font-semibold text-gray-900 lg:text-6xl dark:text-white">
|
|
234
|
-
{strategyDetail.name}
|
|
235
|
-
</h1>
|
|
236
|
-
<p class="text-xl text-gray-600 lg:text-2xl dark:text-gray-400">
|
|
237
|
-
{deployment.description}
|
|
238
|
-
</p>
|
|
239
|
-
</div>
|
|
240
|
-
{/if}
|
|
241
219
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
220
|
+
{#if selectTokens && selectTokens.length > 0}
|
|
221
|
+
<div class="flex w-full flex-col gap-4">
|
|
222
|
+
<DeploymentSectionHeader
|
|
223
|
+
title="Select Tokens"
|
|
224
|
+
description="Select the tokens that you want to use in your order."
|
|
225
|
+
/>
|
|
226
|
+
{#each selectTokens as token}
|
|
227
|
+
<SelectToken {token} {onSelectTokenSelect} {tokenBalances} />
|
|
228
|
+
{/each}
|
|
229
|
+
</div>
|
|
230
|
+
{/if}
|
|
231
|
+
|
|
232
|
+
{#if allTokensSelected || selectTokens?.length === 0}
|
|
233
|
+
{#if allFieldDefinitionsWithoutDefaults.length > 0}
|
|
234
|
+
{#each allFieldDefinitionsWithoutDefaults as fieldDefinition}
|
|
235
|
+
<FieldDefinitionInput {fieldDefinition} />
|
|
236
|
+
{/each}
|
|
252
237
|
{/if}
|
|
253
238
|
|
|
254
|
-
{
|
|
255
|
-
{#if allFieldDefinitionsWithoutDefaults.length > 0}
|
|
256
|
-
{#each allFieldDefinitionsWithoutDefaults as fieldDefinition}
|
|
257
|
-
<FieldDefinitionInput {fieldDefinition} {gui} />
|
|
258
|
-
{/each}
|
|
259
|
-
{/if}
|
|
239
|
+
<Toggle bind:checked={showAdvancedOptions}>Show advanced options</Toggle>
|
|
260
240
|
|
|
261
|
-
|
|
241
|
+
{#if showAdvancedOptions}
|
|
242
|
+
{#each allFieldDefinitionsWithDefaults as fieldDefinition}
|
|
243
|
+
<FieldDefinitionInput {fieldDefinition} />
|
|
244
|
+
{/each}
|
|
262
245
|
|
|
263
|
-
{#
|
|
264
|
-
{
|
|
265
|
-
|
|
266
|
-
{/each}
|
|
267
|
-
{/if}
|
|
246
|
+
{#each allDepositFields as deposit}
|
|
247
|
+
<DepositInput {deposit} />
|
|
248
|
+
{/each}
|
|
268
249
|
|
|
269
|
-
{#
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
{/each}
|
|
273
|
-
{/if}
|
|
250
|
+
{#each allTokenOutputs as output}
|
|
251
|
+
<TokenIOInput label="Output" vault={output} {tokenBalances} />
|
|
252
|
+
{/each}
|
|
274
253
|
|
|
275
|
-
{#
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
254
|
+
{#each allTokenInputs as input}
|
|
255
|
+
<TokenIOInput label="Input" vault={input} {tokenBalances} />
|
|
256
|
+
{/each}
|
|
257
|
+
{/if}
|
|
279
258
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
{
|
|
283
|
-
|
|
259
|
+
{#if $deploymentStepsError}
|
|
260
|
+
<Alert color="red">
|
|
261
|
+
<p class="text-red-500">{$deploymentStepsError.code}</p>
|
|
262
|
+
{#if $deploymentStepsError.details}
|
|
263
|
+
<p class="text-red-500">{$deploymentStepsError.details}</p>
|
|
264
|
+
{/if}
|
|
265
|
+
</Alert>
|
|
266
|
+
{/if}
|
|
284
267
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
268
|
+
<div class="flex flex-wrap items-start justify-start gap-2">
|
|
269
|
+
{#if $account}
|
|
270
|
+
<Button
|
|
271
|
+
data-testid="deploy-button"
|
|
272
|
+
size="lg"
|
|
273
|
+
disabled={checkingDeployment}
|
|
274
|
+
on:click={handleDeployButtonClick}
|
|
275
|
+
class="bg-gradient-to-br from-blue-600 to-violet-600"
|
|
276
|
+
>
|
|
277
|
+
{#if checkingDeployment}
|
|
278
|
+
<Spinner size="4" color="white" />
|
|
279
|
+
<span class="ml-2">Checking deployment...</span>
|
|
280
|
+
{:else}
|
|
281
|
+
Deploy Order
|
|
290
282
|
{/if}
|
|
291
|
-
</
|
|
283
|
+
</Button>
|
|
284
|
+
{:else}
|
|
285
|
+
<WalletConnect {appKitModal} connected={wagmiConnected} />
|
|
292
286
|
{/if}
|
|
293
|
-
|
|
294
|
-
<
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
on:click={handleDeployButtonClick}
|
|
299
|
-
class="bg-gradient-to-br from-blue-600 to-violet-600"
|
|
300
|
-
>
|
|
301
|
-
{#if checkingDeployment}
|
|
302
|
-
<Spinner size="4" color="white" />
|
|
303
|
-
<span class="ml-2">Checking deployment...</span>
|
|
304
|
-
{:else}
|
|
305
|
-
Deploy Strategy
|
|
306
|
-
{/if}
|
|
307
|
-
</Button>
|
|
308
|
-
{:else}
|
|
309
|
-
<WalletConnect {appKitModal} connected={wagmiConnected} {signerAddress} />
|
|
310
|
-
{/if}
|
|
311
|
-
<ComposedRainlangModal {gui} />
|
|
312
|
-
<ShareChoicesButton handleShareChoices={_handleShareChoices} />
|
|
313
|
-
</div>
|
|
314
|
-
{/if}
|
|
315
|
-
</div>
|
|
316
|
-
{/if}
|
|
287
|
+
<ComposedRainlangModal />
|
|
288
|
+
<ShareChoicesButton handleShareChoices={_handleShareChoices} />
|
|
289
|
+
</div>
|
|
290
|
+
{/if}
|
|
291
|
+
</div>
|
|
317
292
|
{/if}
|
|
318
293
|
</div>
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { type
|
|
3
|
-
import { type NameAndDescriptionCfg } from '@rainlanguage/orderbook/js_api';
|
|
4
|
-
import { type Config } from '@wagmi/core';
|
|
2
|
+
import { type NameAndDescriptionCfg, RaindexOrderBuilder, RaindexClient } from '@rainlanguage/raindex';
|
|
5
3
|
import { type Writable } from 'svelte/store';
|
|
6
4
|
import type { AppKit } from '@reown/appkit';
|
|
7
|
-
import type {
|
|
5
|
+
import type { Account } from '../../types/account';
|
|
8
6
|
declare const __propDef: {
|
|
9
7
|
props: {
|
|
10
|
-
|
|
11
|
-
dotrain: string;
|
|
12
|
-
deployment: {
|
|
8
|
+
/** The deployment configuration containing key, name and description */ deployment: {
|
|
13
9
|
key: string;
|
|
14
10
|
name: string;
|
|
15
11
|
description: string;
|
|
16
12
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
handleDisclaimerModal: (args: DisclaimerModalProps) => void;
|
|
20
|
-
wagmiConfig: Writable<Config | undefined>;
|
|
13
|
+
/** Strategy details containing name and description configuration */ orderDetail: NameAndDescriptionCfg;
|
|
14
|
+
/** Handlers for deployment modals */ onDeploy: (raindexClient: RaindexClient, builder: RaindexOrderBuilder) => void;
|
|
21
15
|
wagmiConnected: Writable<boolean>;
|
|
22
16
|
appKitModal: Writable<AppKit>;
|
|
23
|
-
|
|
17
|
+
account: Account;
|
|
24
18
|
};
|
|
25
19
|
events: {
|
|
26
20
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { page } from "$app/stores";
|
|
2
2
|
import { onMount } from "svelte";
|
|
3
|
-
export let
|
|
3
|
+
export let orderName;
|
|
4
4
|
export let key;
|
|
5
5
|
export let name;
|
|
6
6
|
export let description;
|
|
@@ -11,7 +11,7 @@ onMount(async () => {
|
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<a
|
|
14
|
-
href={`/deploy/${
|
|
14
|
+
href={`/deploy/${orderName}/${key}${customRegistryParam}`}
|
|
15
15
|
class="flex h-full w-full max-w-sm cursor-pointer flex-col gap-y-4 rounded-3xl border border-gray-200 bg-white p-4 text-left hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700"
|
|
16
16
|
>
|
|
17
17
|
<h1 class="text-2xl font-semibold text-gray-900 dark:text-white">{name}</h1>
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
|
|
3
|
-
export let
|
|
4
|
-
|
|
1
|
+
<script>import DeploymentTile from "./DeploymentTile.svelte";
|
|
2
|
+
export let deployments = [];
|
|
3
|
+
export let orderName;
|
|
4
|
+
$: deploymentEntries = deployments instanceof Map ? Array.from(deployments.entries()) : deployments ?? [];
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
|
-
{#
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
>
|
|
19
|
-
{#each result.value as [key, { name, description }]}
|
|
20
|
-
<DeploymentTile {name} {description} {key} {strategyName} />
|
|
21
|
-
{/each}
|
|
22
|
-
</div>
|
|
23
|
-
{/if}
|
|
24
|
-
{/await}
|
|
7
|
+
{#if deploymentEntries.length === 0}
|
|
8
|
+
<p class="text-gray-500">No deployments found for this order.</p>
|
|
9
|
+
{:else}
|
|
10
|
+
<div
|
|
11
|
+
class="mr-auto grid w-full grid-cols-1 justify-items-start gap-4 md:grid-cols-2 lg:w-auto lg:grid-cols-3"
|
|
12
|
+
>
|
|
13
|
+
{#each deploymentEntries as [key, { name, description }]}
|
|
14
|
+
<DeploymentTile {name} {description} {key} {orderName} />
|
|
15
|
+
{/each}
|
|
16
|
+
</div>
|
|
17
|
+
{/if}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { NameAndDescriptionCfg } from '@rainlanguage/raindex';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
deployments?: Map<string, NameAndDescriptionCfg> | [string, NameAndDescriptionCfg][];
|
|
6
|
+
orderName: string;
|
|
6
7
|
};
|
|
7
8
|
events: {
|
|
8
9
|
[evt: string]: CustomEvent<any>;
|