@rainlanguage/ui-components 0.0.1-alpha.24 → 0.0.1-alpha.240
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/__fixtures__/settings.yaml +123 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte +4 -0
- package/dist/__mocks__/CodeMirrorRainlang.svelte.d.ts +18 -0
- package/dist/__mocks__/MockCodeMirrorEditor.svelte +17 -0
- package/dist/__mocks__/MockCodeMirrorEditor.svelte.d.ts +21 -0
- package/dist/__mocks__/MockComponent.js +1 -1
- package/dist/__mocks__/MockComponent.svelte +10 -2
- package/dist/__mocks__/MockComponent.svelte.d.ts +4 -1
- package/dist/__mocks__/mockWeb3Config.d.ts +1 -1
- package/dist/__mocks__/mockWeb3Config.js +10 -7
- package/dist/__mocks__/queries.js +9 -9
- package/dist/__mocks__/stores.d.ts +55 -45
- package/dist/__mocks__/stores.js +85 -68
- package/dist/app.css +3 -3
- package/dist/components/ButtonDarkMode.svelte +7 -1
- package/dist/components/ButtonLoading.svelte +1 -1
- package/dist/components/ButtonScrub.svelte +22 -0
- package/dist/components/ButtonScrub.svelte.d.ts +25 -0
- package/dist/components/ButtonVaultLink.svelte +12 -11
- package/dist/components/ButtonVaultLink.svelte.d.ts +4 -3
- package/dist/components/CheckboxInactiveOrdersVault.svelte +20 -0
- package/dist/components/CheckboxInactiveOrdersVault.svelte.d.ts +19 -0
- package/dist/components/CheckboxZeroBalanceVault.svelte.d.ts +2 -2
- package/dist/components/CodeMirrorDotrain.svelte +4 -0
- package/dist/components/CodeMirrorDotrain.svelte.d.ts +1 -0
- package/dist/components/CodeMirrorRainlang.svelte +20 -12
- package/dist/components/CodeMirrorRainlang.svelte.d.ts +3 -2
- package/dist/components/EditableSpan.svelte +3 -14
- package/dist/components/EditableSpan.svelte.d.ts +0 -1
- package/dist/components/Hash.svelte +6 -5
- package/dist/components/License.svelte +5 -4
- package/dist/components/ListViewRaindexFilters.svelte +64 -0
- package/dist/components/ListViewRaindexFilters.svelte.d.ts +32 -0
- package/dist/components/LocalDbStatusBadge.svelte +27 -0
- package/dist/components/LocalDbStatusBadge.svelte.d.ts +19 -0
- package/dist/components/LocalDbStatusCard.svelte +43 -0
- package/dist/components/LocalDbStatusCard.svelte.d.ts +20 -0
- package/dist/components/LocalDbStatusModal.svelte +105 -0
- package/dist/components/LocalDbStatusModal.svelte.d.ts +21 -0
- package/dist/components/OrderOrVaultHash.svelte +12 -12
- package/dist/components/OrderOrVaultHash.svelte.d.ts +4 -4
- package/dist/components/PageHeader.svelte +1 -1
- package/dist/components/Sensitive.svelte +16 -0
- package/dist/components/Sensitive.svelte.d.ts +28 -0
- package/dist/components/TanstackAppTable.svelte +270 -60
- package/dist/components/TanstackAppTable.svelte.d.ts +15 -9
- package/dist/components/ToastDetail.svelte +42 -0
- package/dist/components/ToastDetail.svelte.d.ts +20 -0
- package/dist/components/Tooltip.svelte +8 -0
- package/dist/components/Tooltip.svelte.d.ts +21 -0
- package/dist/components/VaultBalanceChangeTypeFilter.svelte +23 -0
- package/dist/components/VaultBalanceChangeTypeFilter.svelte.d.ts +19 -0
- package/dist/components/VaultCard.svelte +18 -0
- package/dist/components/VaultCard.svelte.d.ts +19 -0
- package/dist/components/charts/LightweightChart.svelte +1 -1
- package/dist/components/charts/LightweightChart.svelte.d.ts +5 -5
- package/dist/components/charts/OrderTradesChart.svelte +319 -28
- package/dist/components/charts/OrderTradesChart.svelte.d.ts +4 -4
- package/dist/components/charts/TanstackLightweightChartLine.svelte +5 -9
- package/dist/components/charts/VaultBalanceChart.svelte +8 -26
- package/dist/components/charts/VaultBalanceChart.svelte.d.ts +1 -7
- package/dist/components/charts/transformAndSortData.d.ts +24 -0
- package/dist/components/charts/transformAndSortData.js +111 -0
- package/dist/components/checkbox/CheckboxActiveOrders.svelte +11 -0
- package/dist/components/checkbox/CheckboxActiveOrders.svelte.d.ts +19 -0
- package/dist/components/deployment/ButtonSelectOption.svelte +2 -0
- package/dist/components/deployment/ButtonSelectOption.svelte.d.ts +1 -0
- package/dist/components/deployment/ComposedRainlangModal.svelte +3 -2
- package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +1 -4
- package/dist/components/deployment/DeploymentSectionHeader.svelte +7 -4
- package/dist/components/deployment/DeploymentSteps.svelte +196 -221
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +6 -12
- package/dist/components/deployment/DeploymentTile.svelte +2 -2
- package/dist/components/deployment/DeploymentTile.svelte.d.ts +1 -1
- package/dist/components/deployment/DeploymentsSection.svelte +15 -22
- package/dist/components/deployment/DeploymentsSection.svelte.d.ts +3 -2
- package/dist/components/deployment/DepositInput.svelte +10 -11
- package/dist/components/deployment/DepositInput.svelte.d.ts +2 -3
- package/dist/components/deployment/DisclaimerModal.svelte +6 -7
- package/dist/components/deployment/FieldDefinitionInput.svelte +10 -14
- package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +2 -3
- package/dist/components/deployment/InvalidOrdersSection.svelte +17 -0
- package/dist/components/deployment/InvalidOrdersSection.svelte.d.ts +19 -0
- package/dist/components/deployment/{StrategyPage.svelte → OrderPage.svelte} +15 -24
- package/dist/components/deployment/OrderPage.svelte.d.ts +21 -0
- package/dist/components/deployment/SelectToken.svelte +127 -50
- package/dist/components/deployment/SelectToken.svelte.d.ts +5 -4
- package/dist/components/deployment/TokenBalance.svelte +19 -0
- package/dist/components/deployment/TokenBalance.svelte.d.ts +19 -0
- package/dist/components/deployment/TokenIOInput.svelte +27 -17
- package/dist/components/deployment/TokenIOInput.svelte.d.ts +3 -3
- package/dist/components/deployment/TokenSelectionModal.svelte +148 -0
- package/dist/components/deployment/TokenSelectionModal.svelte.d.ts +20 -0
- package/dist/components/deployment/{ValidStrategiesSection.svelte → ValidOrdersSection.svelte} +7 -7
- package/dist/components/deployment/ValidOrdersSection.svelte.d.ts +19 -0
- package/dist/components/deployment/VaultIdInformation.svelte +17 -0
- package/dist/components/deployment/VaultIdInformation.svelte.d.ts +21 -0
- package/dist/components/detail/OrderDetail.svelte +220 -82
- package/dist/components/detail/OrderDetail.svelte.d.ts +21 -15
- package/dist/components/detail/TanstackOrderQuote.svelte +114 -46
- package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +14 -16
- package/dist/components/detail/VaultDetail.svelte +82 -79
- package/dist/components/detail/VaultDetail.svelte.d.ts +12 -18
- package/dist/components/dropdown/DropdownActiveNetworks.svelte +44 -0
- package/dist/components/dropdown/DropdownActiveNetworks.svelte.d.ts +19 -0
- package/dist/components/dropdown/DropdownCheckbox.svelte +4 -4
- package/dist/components/dropdown/DropdownRaindexesFilter.svelte +172 -0
- package/dist/components/dropdown/DropdownRaindexesFilter.svelte.d.ts +25 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte +152 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte.d.ts +28 -0
- package/dist/components/icon/Refresh.svelte +4 -2
- package/dist/components/icon/Refresh.svelte.d.ts +2 -0
- package/dist/components/input/InputOrderHash.svelte +1 -1
- package/dist/components/input/InputOrderHash.svelte.d.ts +3 -3
- package/dist/components/input/InputOwnerFilter.svelte +48 -0
- package/dist/components/input/InputOwnerFilter.svelte.d.ts +19 -0
- package/dist/components/input/InputRegistryUrl.svelte +36 -14
- package/dist/components/input/InputToken.svelte +2 -2
- package/dist/components/input/InputTokenAmount.svelte +30 -20
- package/dist/components/input/InputTokenAmount.svelte.d.ts +3 -3
- package/dist/components/tables/OrderAPY.svelte +6 -33
- package/dist/components/tables/OrderAPY.svelte.d.ts +1 -4
- package/dist/components/tables/OrderTradesListTable.svelte +132 -124
- package/dist/components/tables/OrderTradesListTable.svelte.d.ts +4 -4
- package/dist/components/tables/OrderVaultsVolTable.svelte +17 -22
- package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +2 -2
- package/dist/components/tables/OrdersListTable.svelte +206 -115
- package/dist/components/tables/OrdersListTable.svelte.d.ts +18 -23
- package/dist/components/tables/VaultBalanceChangesTable.svelte +83 -43
- package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +13 -11
- package/dist/components/tables/VaultsListTable.svelte +275 -150
- package/dist/components/tables/VaultsListTable.svelte.d.ts +24 -33
- package/dist/components/transactions/FixedBottomTransaction.svelte +64 -0
- package/dist/components/transactions/FixedBottomTransaction.svelte.d.ts +16 -0
- package/dist/components/transactions/TransactionDetail.svelte +31 -0
- package/dist/components/transactions/TransactionDetail.svelte.d.ts +20 -0
- package/dist/components/transactions/TransactionList.svelte +17 -0
- package/dist/components/transactions/TransactionList.svelte.d.ts +16 -0
- package/dist/components/transactions/getStatusEmoji.d.ts +2 -0
- package/dist/components/transactions/getStatusEmoji.js +20 -0
- package/dist/components/wallet/WalletConnect.svelte +5 -4
- package/dist/components/wallet/WalletConnect.svelte.d.ts +0 -1
- package/dist/consts.d.ts +1 -0
- package/dist/consts.js +1 -0
- package/dist/errors/DeploymentStepsError.d.ts +11 -5
- package/dist/errors/DeploymentStepsError.js +13 -7
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/hooks/useLocalDb.d.ts +3 -0
- package/dist/hooks/useLocalDb.js +10 -0
- package/dist/hooks/useRaindexClient.d.ts +3 -0
- package/dist/hooks/useRaindexClient.js +11 -0
- package/dist/hooks/useRaindexOrderBuilder.d.ts +3 -0
- package/dist/hooks/useRaindexOrderBuilder.js +11 -0
- package/dist/index.d.ts +122 -91
- package/dist/index.js +118 -87
- package/dist/models/Transaction.d.ts +75 -0
- package/dist/models/Transaction.js +100 -0
- package/dist/providers/LocalDbProvider.svelte +8 -0
- package/dist/providers/LocalDbProvider.svelte.d.ts +21 -0
- package/dist/providers/RaindexClientProvider.svelte +8 -0
- package/dist/providers/RaindexClientProvider.svelte.d.ts +21 -0
- package/dist/providers/RaindexOrderBuilderProvider.svelte +8 -0
- package/dist/providers/RaindexOrderBuilderProvider.svelte.d.ts +21 -0
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte +8 -0
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte.d.ts +24 -0
- package/dist/providers/dotrainRegistry/context.d.ts +9 -0
- package/dist/providers/dotrainRegistry/context.js +43 -0
- package/dist/providers/dotrainRegistry/useDotrainRegistry.d.ts +5 -0
- package/dist/providers/dotrainRegistry/useDotrainRegistry.js +35 -0
- package/dist/providers/registry/RegistryManager.d.ts +65 -0
- package/dist/providers/registry/RegistryManager.js +134 -0
- package/dist/providers/registry/RegistryProvider.svelte +6 -0
- package/dist/providers/registry/RegistryProvider.svelte.d.ts +21 -0
- package/dist/providers/registry/context.d.ts +10 -0
- package/dist/providers/registry/context.js +46 -0
- package/dist/providers/registry/useRegistry.d.ts +7 -0
- package/dist/providers/registry/useRegistry.js +29 -0
- package/dist/providers/toasts/ToastProvider.svelte +17 -0
- package/dist/providers/toasts/ToastProvider.svelte.d.ts +18 -0
- package/dist/providers/toasts/context.d.ts +14 -0
- package/dist/providers/toasts/context.js +22 -0
- package/dist/providers/toasts/useToasts.d.ts +16 -0
- package/dist/providers/toasts/useToasts.js +63 -0
- package/dist/providers/transactions/TransactionManager.d.ts +234 -0
- package/dist/providers/transactions/TransactionManager.js +509 -0
- package/dist/providers/transactions/TransactionProvider.svelte +11 -0
- package/dist/providers/transactions/TransactionProvider.svelte.d.ts +24 -0
- package/dist/providers/transactions/context.d.ts +19 -0
- package/dist/providers/transactions/context.js +28 -0
- package/dist/providers/transactions/useTransactions.d.ts +13 -0
- package/dist/providers/transactions/useTransactions.js +18 -0
- package/dist/providers/wallet/WalletProvider.svelte +7 -0
- package/dist/providers/wallet/WalletProvider.svelte.d.ts +21 -0
- package/dist/providers/wallet/context.d.ts +10 -0
- package/dist/providers/wallet/context.js +47 -0
- package/dist/providers/wallet/useAccount.d.ts +8 -0
- package/dist/providers/wallet/useAccount.js +148 -0
- package/dist/queries/keys.d.ts +1 -0
- package/dist/queries/keys.js +10 -9
- package/dist/queries/queryClient.d.ts +2 -2
- package/dist/queries/queryClient.js +16 -11
- package/dist/services/awaitTransactionIndexing.d.ts +107 -0
- package/dist/services/awaitTransactionIndexing.js +60 -0
- package/dist/services/getExplorerLink.d.ts +1 -1
- package/dist/services/getExplorerLink.js +3 -5
- package/dist/services/handleShareChoices.d.ts +2 -2
- package/dist/services/handleShareChoices.js +6 -5
- package/dist/services/historicalOrderCharts.d.ts +3 -3
- package/dist/services/historicalOrderCharts.js +364 -371
- package/dist/services/index.d.ts +5 -2
- package/dist/services/index.js +3 -1
- package/dist/services/loadRegistryUrl.d.ts +2 -0
- package/dist/services/loadRegistryUrl.js +22 -0
- package/dist/services/pairTradesChartData.d.ts +47 -0
- package/dist/services/pairTradesChartData.js +194 -0
- package/dist/services/registry.d.ts +5 -5
- package/dist/services/registry.js +17 -217
- package/dist/services/time.d.ts +12 -0
- package/dist/services/time.js +88 -6
- package/dist/services/validateAmount.d.ts +30 -0
- package/dist/services/validateAmount.js +53 -0
- package/dist/storesGeneric/cachedWritableStore.d.ts +57 -0
- package/dist/storesGeneric/cachedWritableStore.js +93 -0
- package/dist/storesGeneric/scrub.d.ts +14 -0
- package/dist/storesGeneric/scrub.js +22 -0
- package/dist/test/matchers.d.ts +2 -2
- package/dist/test/matchers.js +2 -2
- package/dist/types/account.d.ts +3 -0
- package/dist/types/appStores.d.ts +9 -16
- package/dist/types/modal.d.ts +26 -14
- package/dist/types/order.d.ts +10 -0
- package/dist/types/order.js +1 -0
- package/dist/types/toast.d.ts +11 -0
- package/dist/types/toast.js +1 -0
- package/dist/types/tokenBalance.d.ts +6 -0
- package/dist/types/tokenBalance.js +1 -0
- package/dist/types/transaction.d.ts +67 -22
- package/dist/types/transaction.js +31 -1
- package/dist/utils/breadcrumbs.js +2 -2
- package/dist/utils/codeMirrorThemes.js +80 -74
- package/dist/utils/configHelpers.d.ts +4 -0
- package/dist/utils/configHelpers.js +21 -0
- package/dist/utils/constructHashLink.d.ts +24 -0
- package/dist/utils/constructHashLink.js +117 -0
- package/dist/utils/getNetworkName.d.ts +1 -0
- package/dist/utils/getNetworkName.js +13 -0
- package/dist/utils/hex.js +1 -1
- package/dist/utils/lightweightChartsThemes.d.ts +1 -1
- package/dist/utils/lightweightChartsThemes.js +11 -11
- package/dist/utils/localDbStatus.d.ts +26 -0
- package/dist/utils/localDbStatus.js +22 -0
- package/dist/utils/number.d.ts +0 -7
- package/dist/utils/number.js +5 -30
- package/dist/utils/stripTrailingWhitespace.d.ts +16 -0
- package/dist/utils/stripTrailingWhitespace.js +22 -0
- package/dist/utils/tokens.d.ts +2 -0
- package/dist/utils/tokens.js +3 -0
- package/dist/utils/vaultBalanceChangeLabels.d.ts +4 -0
- package/dist/utils/vaultBalanceChangeLabels.js +18 -0
- package/package.json +89 -84
- package/dist/__fixtures__/orderDetail.d.ts +0 -99
- package/dist/__fixtures__/orderDetail.js +0 -204
- package/dist/__fixtures__/settings-12-11-24.json +0 -160
- package/dist/__mocks__/mockTransactionStore.d.ts +0 -22
- package/dist/__mocks__/mockTransactionStore.js +0 -56
- package/dist/__mocks__/settings.d.ts +0 -3
- package/dist/__mocks__/settings.js +0 -37
- package/dist/components/CheckboxMyItemsOnly.svelte +0 -23
- package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +0 -21
- package/dist/components/ListViewOrderbookFilters.svelte +0 -58
- package/dist/components/ListViewOrderbookFilters.svelte.d.ts +0 -28
- package/dist/components/deployment/InvalidStrategiesSection.svelte +0 -19
- package/dist/components/deployment/InvalidStrategiesSection.svelte.d.ts +0 -19
- package/dist/components/deployment/StrategyPage.svelte.d.ts +0 -19
- package/dist/components/deployment/ValidStrategiesSection.svelte.d.ts +0 -19
- package/dist/components/deployment/getDeploymentTransactionArgs.d.ts +0 -17
- package/dist/components/deployment/getDeploymentTransactionArgs.js +0 -28
- package/dist/components/detail/DepositOrWithdrawButtons.svelte +0 -44
- package/dist/components/detail/DepositOrWithdrawButtons.svelte.d.ts +0 -26
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte +0 -38
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte.d.ts +0 -21
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte +0 -15
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +0 -20
- package/dist/components/dropdown/DropdownOrderStatus.svelte +0 -31
- package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +0 -19
- package/dist/hooks/useGui.d.ts +0 -3
- package/dist/hooks/useGui.js +0 -11
- package/dist/providers/GuiProvider.svelte +0 -8
- package/dist/providers/GuiProvider.svelte.d.ts +0 -21
- package/dist/stores/transactionStore.d.ts +0 -98
- package/dist/stores/transactionStore.js +0 -303
- package/dist/types/strategy.d.ts +0 -10
- package/dist/utils/time.d.ts +0 -12
- package/dist/utils/time.js +0 -27
- package/dist/utils/vault.d.ts +0 -2
- package/dist/utils/vault.js +0 -29
- /package/dist/types/{strategy.js → account.js} +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { TransactionStatus, TransactionErrorMessage } from '../stores/transactionStore';
|
|
2
|
-
type MockTransactionStoreState = {
|
|
3
|
-
status: TransactionStatus;
|
|
4
|
-
error: string;
|
|
5
|
-
hash: string;
|
|
6
|
-
data: null;
|
|
7
|
-
functionName: string;
|
|
8
|
-
message: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const mockTransactionStore: {
|
|
11
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<MockTransactionStoreState>, invalidate?: import("svelte/store").Invalidator<MockTransactionStoreState> | undefined) => import("svelte/store").Unsubscriber;
|
|
12
|
-
set: (this: void, value: MockTransactionStoreState) => void;
|
|
13
|
-
reset: () => void;
|
|
14
|
-
handleDeploymentTransaction: () => Promise<void>;
|
|
15
|
-
checkingWalletAllowance: (message?: string) => void;
|
|
16
|
-
awaitWalletConfirmation: (message?: string) => void;
|
|
17
|
-
awaitApprovalTx: (hash: string) => void;
|
|
18
|
-
transactionSuccess: (hash: string, message?: string) => void;
|
|
19
|
-
transactionError: (error: TransactionErrorMessage, hash?: string) => void;
|
|
20
|
-
mockSetSubscribeValue: (value: Partial<MockTransactionStoreState>) => void;
|
|
21
|
-
};
|
|
22
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { writable } from 'svelte/store';
|
|
2
|
-
import { TransactionStatus, TransactionErrorMessage } from '../stores/transactionStore';
|
|
3
|
-
const initialState = {
|
|
4
|
-
status: TransactionStatus.IDLE,
|
|
5
|
-
error: '',
|
|
6
|
-
hash: '',
|
|
7
|
-
data: null,
|
|
8
|
-
functionName: '',
|
|
9
|
-
message: ''
|
|
10
|
-
};
|
|
11
|
-
const mockTransactionWritable = writable(initialState);
|
|
12
|
-
export const mockTransactionStore = {
|
|
13
|
-
subscribe: mockTransactionWritable.subscribe,
|
|
14
|
-
set: mockTransactionWritable.set,
|
|
15
|
-
reset: () => mockTransactionWritable.set(initialState),
|
|
16
|
-
handleDeploymentTransaction: async () => {
|
|
17
|
-
mockTransactionWritable.update((state) => ({
|
|
18
|
-
...state,
|
|
19
|
-
status: TransactionStatus.SUCCESS,
|
|
20
|
-
message: 'Strategy deployed successfully!',
|
|
21
|
-
hash: '0x123'
|
|
22
|
-
}));
|
|
23
|
-
},
|
|
24
|
-
checkingWalletAllowance: (message = '') => mockTransactionWritable.update((state) => ({
|
|
25
|
-
...state,
|
|
26
|
-
status: TransactionStatus.CHECKING_ALLOWANCE,
|
|
27
|
-
message
|
|
28
|
-
})),
|
|
29
|
-
awaitWalletConfirmation: (message = '') => mockTransactionWritable.update((state) => ({
|
|
30
|
-
...state,
|
|
31
|
-
status: TransactionStatus.PENDING_WALLET,
|
|
32
|
-
message
|
|
33
|
-
})),
|
|
34
|
-
awaitApprovalTx: (hash) => mockTransactionWritable.update((state) => ({
|
|
35
|
-
...state,
|
|
36
|
-
hash,
|
|
37
|
-
status: TransactionStatus.PENDING_APPROVAL,
|
|
38
|
-
message: ''
|
|
39
|
-
})),
|
|
40
|
-
transactionSuccess: (hash, message = '') => mockTransactionWritable.update((state) => ({
|
|
41
|
-
...state,
|
|
42
|
-
status: TransactionStatus.SUCCESS,
|
|
43
|
-
hash,
|
|
44
|
-
message
|
|
45
|
-
})),
|
|
46
|
-
transactionError: (error, hash = '') => mockTransactionWritable.update((state) => ({
|
|
47
|
-
...state,
|
|
48
|
-
status: TransactionStatus.ERROR,
|
|
49
|
-
error,
|
|
50
|
-
hash
|
|
51
|
-
})),
|
|
52
|
-
mockSetSubscribeValue: (value) => mockTransactionWritable.update((state) => ({
|
|
53
|
-
...state,
|
|
54
|
-
...value
|
|
55
|
-
}))
|
|
56
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { writable } from 'svelte/store';
|
|
2
|
-
export const mockConfigSource = {
|
|
3
|
-
networks: {
|
|
4
|
-
mainnet: {
|
|
5
|
-
rpc: 'https://mainnet.infura.io/v3/YOUR-PROJECT-ID',
|
|
6
|
-
'chain-id': 1,
|
|
7
|
-
label: 'Ethereum Mainnet',
|
|
8
|
-
currency: 'ETH'
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
subgraphs: {
|
|
12
|
-
mainnet: 'https://api.thegraph.com/subgraphs/name/mainnet'
|
|
13
|
-
},
|
|
14
|
-
orderbooks: {
|
|
15
|
-
orderbook1: {
|
|
16
|
-
address: '0xOrderbookAddress1',
|
|
17
|
-
network: 'mainnet',
|
|
18
|
-
subgraph: 'uniswap',
|
|
19
|
-
label: 'Orderbook 1'
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
deployers: {
|
|
23
|
-
deployer1: {
|
|
24
|
-
address: '0xDeployerAddress1',
|
|
25
|
-
network: 'mainnet',
|
|
26
|
-
label: 'Deployer 1'
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
metaboards: {
|
|
30
|
-
metaboard1: 'https://example.com/metaboard1'
|
|
31
|
-
},
|
|
32
|
-
accounts: {
|
|
33
|
-
name_one: 'address_one',
|
|
34
|
-
name_two: 'address_two'
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
export const mockSettingsStore = writable(mockConfigSource);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<script>import { Checkbox, Label } from "flowbite-svelte";
|
|
2
|
-
export let showMyItemsOnly;
|
|
3
|
-
export let context;
|
|
4
|
-
export let signerAddress;
|
|
5
|
-
function handleShowMyItemsChange() {
|
|
6
|
-
$showMyItemsOnly = !$showMyItemsOnly;
|
|
7
|
-
}
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<div data-testid="show-my-items-checkbox" class="flex items-center gap-x-2">
|
|
11
|
-
<Label
|
|
12
|
-
for="show-my-items"
|
|
13
|
-
class="cursor-pointer whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
14
|
-
>
|
|
15
|
-
Only show my {context}
|
|
16
|
-
</Label>
|
|
17
|
-
<Checkbox
|
|
18
|
-
id="show-my-items"
|
|
19
|
-
checked={$showMyItemsOnly}
|
|
20
|
-
on:change={handleShowMyItemsChange}
|
|
21
|
-
disabled={!$signerAddress}
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Writable } from 'svelte/store';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
showMyItemsOnly: Writable<boolean>;
|
|
6
|
-
context: "orders" | "vaults";
|
|
7
|
-
signerAddress: Writable<string | null> | undefined;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
exports?: {} | undefined;
|
|
14
|
-
bindings?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
export type CheckboxMyItemsOnlyProps = typeof __propDef.props;
|
|
17
|
-
export type CheckboxMyItemsOnlyEvents = typeof __propDef.events;
|
|
18
|
-
export type CheckboxMyItemsOnlySlots = typeof __propDef.slots;
|
|
19
|
-
export default class CheckboxMyItemsOnly extends SvelteComponent<CheckboxMyItemsOnlyProps, CheckboxMyItemsOnlyEvents, CheckboxMyItemsOnlySlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<script generics="T">import { isEmpty } from "lodash";
|
|
2
|
-
import { Alert, Tooltip } from "flowbite-svelte";
|
|
3
|
-
import DropdownActiveSubgraphs from "./dropdown/DropdownActiveSubgraphs.svelte";
|
|
4
|
-
import DropdownOrderStatus from "./dropdown/DropdownOrderStatus.svelte";
|
|
5
|
-
import DropdownOrderListAccounts from "./dropdown/DropdownOrderListAccounts.svelte";
|
|
6
|
-
import InputOrderHash from "./input/InputOrderHash.svelte";
|
|
7
|
-
import CheckboxZeroBalanceVault from "./CheckboxZeroBalanceVault.svelte";
|
|
8
|
-
import CheckboxMyItemsOnly from "./CheckboxMyItemsOnly.svelte";
|
|
9
|
-
export let settings;
|
|
10
|
-
export let accounts;
|
|
11
|
-
export let hideZeroBalanceVaults;
|
|
12
|
-
export let activeAccountsItems;
|
|
13
|
-
export let showMyItemsOnly;
|
|
14
|
-
export let activeSubgraphs;
|
|
15
|
-
export let activeOrderStatus;
|
|
16
|
-
export let orderHash;
|
|
17
|
-
export let isVaultsPage;
|
|
18
|
-
export let isOrdersPage;
|
|
19
|
-
export let signerAddress;
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<div
|
|
23
|
-
class="grid w-full items-center gap-4 md:flex md:justify-end lg:min-w-[600px]"
|
|
24
|
-
style="grid-template-columns: repeat(2, minmax(0, 1fr));"
|
|
25
|
-
>
|
|
26
|
-
{#if isEmpty($settings?.networks)}
|
|
27
|
-
<Alert color="gray" data-testid="no-networks-alert" class="w-full">
|
|
28
|
-
No networks added to <a class="underline" href="/settings">settings</a>
|
|
29
|
-
</Alert>
|
|
30
|
-
{:else}
|
|
31
|
-
{#if $accounts && !Object.values($accounts).length}
|
|
32
|
-
<div class="mt-4 w-full lg:w-auto" data-testid="my-items-only">
|
|
33
|
-
<CheckboxMyItemsOnly
|
|
34
|
-
context={isVaultsPage ? 'vaults' : 'orders'}
|
|
35
|
-
{showMyItemsOnly}
|
|
36
|
-
{signerAddress}
|
|
37
|
-
/>
|
|
38
|
-
{#if !$signerAddress}
|
|
39
|
-
<Tooltip>Connect a wallet to filter by {isVaultsPage ? 'vault' : 'order'} owner</Tooltip>
|
|
40
|
-
{/if}
|
|
41
|
-
</div>
|
|
42
|
-
{/if}
|
|
43
|
-
{#if isVaultsPage}
|
|
44
|
-
<div class="mt-4 w-full lg:w-auto">
|
|
45
|
-
<CheckboxZeroBalanceVault {hideZeroBalanceVaults} />
|
|
46
|
-
</div>
|
|
47
|
-
{/if}
|
|
48
|
-
|
|
49
|
-
{#if isOrdersPage}
|
|
50
|
-
<InputOrderHash {orderHash} />
|
|
51
|
-
<DropdownOrderStatus {activeOrderStatus} />
|
|
52
|
-
{/if}
|
|
53
|
-
{#if $accounts && Object.values($accounts).length > 0}
|
|
54
|
-
<DropdownOrderListAccounts {accounts} {activeAccountsItems} />
|
|
55
|
-
{/if}
|
|
56
|
-
<DropdownActiveSubgraphs settings={$settings} {activeSubgraphs} />
|
|
57
|
-
{/if}
|
|
58
|
-
</div>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Readable, Writable } from 'svelte/store';
|
|
3
|
-
import type { ConfigSource } from '@rainlanguage/orderbook/js_api';
|
|
4
|
-
declare class __sveltets_Render<T> {
|
|
5
|
-
props(): {
|
|
6
|
-
settings: Writable<ConfigSource | undefined>;
|
|
7
|
-
accounts: Readable<Record<string, string>> | undefined;
|
|
8
|
-
hideZeroBalanceVaults: Writable<boolean>;
|
|
9
|
-
activeAccountsItems: Writable<Record<string, string>> | undefined;
|
|
10
|
-
showMyItemsOnly: Writable<boolean>;
|
|
11
|
-
activeSubgraphs: Writable<Record<string, string>>;
|
|
12
|
-
activeOrderStatus: Writable<boolean | undefined>;
|
|
13
|
-
orderHash: Writable<string>;
|
|
14
|
-
isVaultsPage: boolean;
|
|
15
|
-
isOrdersPage: boolean;
|
|
16
|
-
signerAddress: Writable<string | null> | undefined;
|
|
17
|
-
};
|
|
18
|
-
events(): {} & {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots(): {};
|
|
22
|
-
}
|
|
23
|
-
export type ListViewOrderbookFiltersProps<T> = ReturnType<__sveltets_Render<T>['props']>;
|
|
24
|
-
export type ListViewOrderbookFiltersEvents<T> = ReturnType<__sveltets_Render<T>['events']>;
|
|
25
|
-
export type ListViewOrderbookFiltersSlots<T> = ReturnType<__sveltets_Render<T>['slots']>;
|
|
26
|
-
export default class ListViewOrderbookFilters<T> extends SvelteComponent<ListViewOrderbookFiltersProps<T>, ListViewOrderbookFiltersEvents<T>, ListViewOrderbookFiltersSlots<T>> {
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script>export let strategiesWithErrors;
|
|
2
|
-
</script>
|
|
3
|
-
|
|
4
|
-
<div
|
|
5
|
-
class="flex flex-col gap-4 rounded-xl bg-red-100 p-6 dark:bg-red-900"
|
|
6
|
-
data-testid="invalid-strategies"
|
|
7
|
-
>
|
|
8
|
-
<h2 class="text-xl font-semibold text-gray-900 dark:text-white">
|
|
9
|
-
Invalid Strategies in registry
|
|
10
|
-
</h2>
|
|
11
|
-
<div class="flex flex-col gap-2">
|
|
12
|
-
{#each strategiesWithErrors as strategy}
|
|
13
|
-
<div class="flex flex-col gap-1">
|
|
14
|
-
<span class="font-medium">{strategy.name}</span>
|
|
15
|
-
<span class="text-red-600 dark:text-red-400">{strategy.error}</span>
|
|
16
|
-
</div>
|
|
17
|
-
{/each}
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { InvalidStrategyDetail } from '../../types/strategy';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
strategiesWithErrors: InvalidStrategyDetail[];
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
exports?: {} | undefined;
|
|
12
|
-
bindings?: string | undefined;
|
|
13
|
-
};
|
|
14
|
-
export type InvalidStrategiesSectionProps = typeof __propDef.props;
|
|
15
|
-
export type InvalidStrategiesSectionEvents = typeof __propDef.events;
|
|
16
|
-
export type InvalidStrategiesSectionSlots = typeof __propDef.slots;
|
|
17
|
-
export default class InvalidStrategiesSection extends SvelteComponent<InvalidStrategiesSectionProps, InvalidStrategiesSectionEvents, InvalidStrategiesSectionSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
strategyName?: string;
|
|
5
|
-
dotrain?: string;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
exports?: {} | undefined;
|
|
12
|
-
bindings?: string | undefined;
|
|
13
|
-
};
|
|
14
|
-
export type StrategyPageProps = typeof __propDef.props;
|
|
15
|
-
export type StrategyPageEvents = typeof __propDef.events;
|
|
16
|
-
export type StrategyPageSlots = typeof __propDef.slots;
|
|
17
|
-
export default class StrategyPage extends SvelteComponent<StrategyPageProps, StrategyPageEvents, StrategyPageSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { ValidStrategyDetail } from '../../types/strategy';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
strategies: ValidStrategyDetail[];
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
exports?: {} | undefined;
|
|
12
|
-
bindings?: string | undefined;
|
|
13
|
-
};
|
|
14
|
-
export type ValidStrategiesSectionProps = typeof __propDef.props;
|
|
15
|
-
export type ValidStrategiesSectionEvents = typeof __propDef.events;
|
|
16
|
-
export type ValidStrategiesSectionSlots = typeof __propDef.slots;
|
|
17
|
-
export default class ValidStrategiesSection extends SvelteComponent<ValidStrategiesSectionProps, ValidStrategiesSectionEvents, ValidStrategiesSectionSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Config } from '@wagmi/core';
|
|
2
|
-
import type { DepositAndAddOrderCalldataResult, DotrainOrderGui } from '@rainlanguage/orderbook/js_api';
|
|
3
|
-
import type { Hex } from 'viem';
|
|
4
|
-
import type { ExtendedApprovalCalldata } from '../../stores/transactionStore';
|
|
5
|
-
export declare enum AddOrderErrors {
|
|
6
|
-
ADD_ORDER_FAILED = "Failed to add order",
|
|
7
|
-
MISSING_GUI = "Order GUI is required",
|
|
8
|
-
MISSING_CONFIG = "Wagmi config is required",
|
|
9
|
-
NO_WALLET = "No wallet address found"
|
|
10
|
-
}
|
|
11
|
-
export interface HandleAddOrderResult {
|
|
12
|
-
approvals: ExtendedApprovalCalldata[];
|
|
13
|
-
deploymentCalldata: DepositAndAddOrderCalldataResult;
|
|
14
|
-
orderbookAddress: Hex;
|
|
15
|
-
chainId: number;
|
|
16
|
-
}
|
|
17
|
-
export declare function getDeploymentTransactionArgs(gui: DotrainOrderGui, wagmiConfig: Config | undefined): Promise<HandleAddOrderResult>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { getAccount } from '@wagmi/core';
|
|
2
|
-
export var AddOrderErrors;
|
|
3
|
-
(function (AddOrderErrors) {
|
|
4
|
-
AddOrderErrors["ADD_ORDER_FAILED"] = "Failed to add order";
|
|
5
|
-
AddOrderErrors["MISSING_GUI"] = "Order GUI is required";
|
|
6
|
-
AddOrderErrors["MISSING_CONFIG"] = "Wagmi config is required";
|
|
7
|
-
AddOrderErrors["NO_WALLET"] = "No wallet address found";
|
|
8
|
-
})(AddOrderErrors || (AddOrderErrors = {}));
|
|
9
|
-
export async function getDeploymentTransactionArgs(gui, wagmiConfig) {
|
|
10
|
-
if (!wagmiConfig) {
|
|
11
|
-
throw new Error(AddOrderErrors.MISSING_CONFIG);
|
|
12
|
-
}
|
|
13
|
-
const { address } = getAccount(wagmiConfig);
|
|
14
|
-
if (!address) {
|
|
15
|
-
throw new Error(AddOrderErrors.NO_WALLET);
|
|
16
|
-
}
|
|
17
|
-
const result = await gui.getDeploymentTransactionArgs(address);
|
|
18
|
-
if (result.error) {
|
|
19
|
-
throw new Error(result.error.msg);
|
|
20
|
-
}
|
|
21
|
-
const { approvals, deploymentCalldata, orderbookAddress, chainId } = result.value;
|
|
22
|
-
return {
|
|
23
|
-
approvals,
|
|
24
|
-
deploymentCalldata,
|
|
25
|
-
orderbookAddress: orderbookAddress,
|
|
26
|
-
chainId
|
|
27
|
-
};
|
|
28
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<script>import { Button } from "flowbite-svelte";
|
|
2
|
-
import { ArrowDownOutline, ArrowUpOutline } from "flowbite-svelte-icons";
|
|
3
|
-
export let handleDepositOrWithdrawModal;
|
|
4
|
-
export let vault;
|
|
5
|
-
export let chainId;
|
|
6
|
-
export let rpcUrl;
|
|
7
|
-
export let query;
|
|
8
|
-
export let subgraphUrl;
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<Button
|
|
12
|
-
data-testid="depositOrWithdrawButton"
|
|
13
|
-
color="light"
|
|
14
|
-
size="xs"
|
|
15
|
-
on:click={() =>
|
|
16
|
-
handleDepositOrWithdrawModal({
|
|
17
|
-
open: true,
|
|
18
|
-
args: {
|
|
19
|
-
vault,
|
|
20
|
-
onDepositOrWithdraw: $query.refetch,
|
|
21
|
-
action: 'deposit',
|
|
22
|
-
chainId,
|
|
23
|
-
rpcUrl,
|
|
24
|
-
subgraphUrl
|
|
25
|
-
}
|
|
26
|
-
})}><ArrowUpOutline size="xs" /></Button
|
|
27
|
-
>
|
|
28
|
-
<Button
|
|
29
|
-
data-testid="depositOrWithdrawButton"
|
|
30
|
-
color="light"
|
|
31
|
-
size="xs"
|
|
32
|
-
on:click={() =>
|
|
33
|
-
handleDepositOrWithdrawModal({
|
|
34
|
-
open: true,
|
|
35
|
-
args: {
|
|
36
|
-
vault,
|
|
37
|
-
onDepositOrWithdraw: $query.refetch,
|
|
38
|
-
action: 'withdraw',
|
|
39
|
-
chainId,
|
|
40
|
-
rpcUrl,
|
|
41
|
-
subgraphUrl
|
|
42
|
-
}
|
|
43
|
-
})}><ArrowDownOutline size="xs" /></Button
|
|
44
|
-
>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { SgVault } from '@rainlanguage/orderbook/js_api';
|
|
3
|
-
import type { CreateQueryResult } from '@tanstack/svelte-query';
|
|
4
|
-
import type { DepositOrWithdrawModalProps } from '../../types/modal';
|
|
5
|
-
declare const __propDef: {
|
|
6
|
-
props: {
|
|
7
|
-
handleDepositOrWithdrawModal: (props: DepositOrWithdrawModalProps) => void;
|
|
8
|
-
vault: SgVault;
|
|
9
|
-
chainId: number;
|
|
10
|
-
rpcUrl: string;
|
|
11
|
-
query: CreateQueryResult;
|
|
12
|
-
subgraphUrl: string;
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {};
|
|
18
|
-
exports?: {} | undefined;
|
|
19
|
-
bindings?: string | undefined;
|
|
20
|
-
};
|
|
21
|
-
export type DepositOrWithdrawButtonsProps = typeof __propDef.props;
|
|
22
|
-
export type DepositOrWithdrawButtonsEvents = typeof __propDef.events;
|
|
23
|
-
export type DepositOrWithdrawButtonsSlots = typeof __propDef.slots;
|
|
24
|
-
export default class DepositOrWithdrawButtons extends SvelteComponent<DepositOrWithdrawButtonsProps, DepositOrWithdrawButtonsEvents, DepositOrWithdrawButtonsSlots> {
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script>import DropdownCheckbox from "./DropdownCheckbox.svelte";
|
|
2
|
-
export let settings;
|
|
3
|
-
export let activeSubgraphs;
|
|
4
|
-
$: dropdownOptions = Object.keys(settings?.subgraphs ?? {}).reduce(
|
|
5
|
-
(acc, key) => ({
|
|
6
|
-
...acc,
|
|
7
|
-
[key]: key
|
|
8
|
-
}),
|
|
9
|
-
{}
|
|
10
|
-
);
|
|
11
|
-
function handleStatusChange(event) {
|
|
12
|
-
let items = Object.keys(event.detail);
|
|
13
|
-
activeSubgraphs.set(
|
|
14
|
-
Object.values(items).reduce(
|
|
15
|
-
(acc, key) => ({ ...acc, [key]: (settings?.subgraphs ?? {})[key] }),
|
|
16
|
-
{}
|
|
17
|
-
)
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
$: value = Object.keys($activeSubgraphs).length === 0 ? {} : Object.keys($activeSubgraphs).reduce(
|
|
21
|
-
(acc, key) => ({
|
|
22
|
-
...acc,
|
|
23
|
-
[key]: key
|
|
24
|
-
}),
|
|
25
|
-
{}
|
|
26
|
-
);
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<div data-testid="subgraphs-dropdown">
|
|
30
|
-
<DropdownCheckbox
|
|
31
|
-
options={dropdownOptions}
|
|
32
|
-
on:change={handleStatusChange}
|
|
33
|
-
label="Networks"
|
|
34
|
-
showAllLabel={false}
|
|
35
|
-
onlyTitle={true}
|
|
36
|
-
{value}
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Writable } from 'svelte/store';
|
|
3
|
-
import type { ConfigSource } from '@rainlanguage/orderbook/js_api';
|
|
4
|
-
declare const __propDef: {
|
|
5
|
-
props: {
|
|
6
|
-
settings: ConfigSource;
|
|
7
|
-
activeSubgraphs: Writable<Record<string, string>>;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
exports?: {} | undefined;
|
|
14
|
-
bindings?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
export type DropdownActiveSubgraphsProps = typeof __propDef.props;
|
|
17
|
-
export type DropdownActiveSubgraphsEvents = typeof __propDef.events;
|
|
18
|
-
export type DropdownActiveSubgraphsSlots = typeof __propDef.slots;
|
|
19
|
-
export default class DropdownActiveSubgraphs extends SvelteComponent<DropdownActiveSubgraphsProps, DropdownActiveSubgraphsEvents, DropdownActiveSubgraphsSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<script>import DropdownCheckbox from "./DropdownCheckbox.svelte";
|
|
2
|
-
export let accounts;
|
|
3
|
-
export let activeAccountsItems;
|
|
4
|
-
$: options = $accounts;
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<div data-testid="accounts-dropdown">
|
|
8
|
-
<DropdownCheckbox
|
|
9
|
-
{options}
|
|
10
|
-
bind:value={$activeAccountsItems}
|
|
11
|
-
label="Accounts"
|
|
12
|
-
allLabel="All accounts"
|
|
13
|
-
emptyMessage="No accounts added"
|
|
14
|
-
/>
|
|
15
|
-
</div>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Writable, Readable } from 'svelte/store';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
accounts: Readable<Record<string, string>> | undefined;
|
|
6
|
-
activeAccountsItems: Writable<Record<string, string>> | undefined;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
exports?: {} | undefined;
|
|
13
|
-
bindings?: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
export type DropdownOrderListAccountsProps = typeof __propDef.props;
|
|
16
|
-
export type DropdownOrderListAccountsEvents = typeof __propDef.events;
|
|
17
|
-
export type DropdownOrderListAccountsSlots = typeof __propDef.slots;
|
|
18
|
-
export default class DropdownOrderListAccounts extends SvelteComponent<DropdownOrderListAccountsProps, DropdownOrderListAccountsEvents, DropdownOrderListAccountsSlots> {
|
|
19
|
-
}
|
|
20
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<script>import DropdownCheckbox from "./DropdownCheckbox.svelte";
|
|
2
|
-
export let activeOrderStatus;
|
|
3
|
-
const orderStatusOptions = {
|
|
4
|
-
Active: "active",
|
|
5
|
-
Inactive: "inactive"
|
|
6
|
-
};
|
|
7
|
-
function handleStatusChange(event) {
|
|
8
|
-
let status = void 0;
|
|
9
|
-
let items = Object.keys(event.detail);
|
|
10
|
-
if (items.length === 0 || items.length === 2) {
|
|
11
|
-
status = void 0;
|
|
12
|
-
} else if (items.includes("Active")) {
|
|
13
|
-
status = true;
|
|
14
|
-
} else if (items.includes("Inactive")) {
|
|
15
|
-
status = false;
|
|
16
|
-
}
|
|
17
|
-
activeOrderStatus.set(status);
|
|
18
|
-
}
|
|
19
|
-
$: value = $activeOrderStatus === void 0 ? {} : $activeOrderStatus ? { Active: "active" } : { Inactive: "inactive" };
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<div data-testid="order-status-dropdown">
|
|
23
|
-
<DropdownCheckbox
|
|
24
|
-
options={orderStatusOptions}
|
|
25
|
-
on:change={handleStatusChange}
|
|
26
|
-
label="Status"
|
|
27
|
-
showAllLabel={false}
|
|
28
|
-
onlyTitle={true}
|
|
29
|
-
{value}
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Writable } from 'svelte/store';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
activeOrderStatus: Writable<boolean | undefined>;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {};
|
|
11
|
-
exports?: {} | undefined;
|
|
12
|
-
bindings?: string | undefined;
|
|
13
|
-
};
|
|
14
|
-
export type DropdownOrderStatusProps = typeof __propDef.props;
|
|
15
|
-
export type DropdownOrderStatusEvents = typeof __propDef.events;
|
|
16
|
-
export type DropdownOrderStatusSlots = typeof __propDef.slots;
|
|
17
|
-
export default class DropdownOrderStatus extends SvelteComponent<DropdownOrderStatusProps, DropdownOrderStatusEvents, DropdownOrderStatusSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
package/dist/hooks/useGui.d.ts
DELETED
package/dist/hooks/useGui.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { getContext } from 'svelte';
|
|
2
|
-
import { DotrainOrderGui } from '@rainlanguage/orderbook/js_api';
|
|
3
|
-
import { DeploymentStepsError, DeploymentStepsErrorCode } from '../errors/DeploymentStepsError';
|
|
4
|
-
export const GUI_CONTEXT_KEY = 'gui-context';
|
|
5
|
-
export function useGui() {
|
|
6
|
-
const gui = getContext(GUI_CONTEXT_KEY);
|
|
7
|
-
if (!gui) {
|
|
8
|
-
DeploymentStepsError.catch(null, DeploymentStepsErrorCode.NO_GUI_PROVIDER);
|
|
9
|
-
}
|
|
10
|
-
return gui;
|
|
11
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { DotrainOrderGui } from '@rainlanguage/orderbook/js_api';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
gui: DotrainOrderGui;
|
|
6
|
-
};
|
|
7
|
-
events: {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
};
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
};
|
|
13
|
-
exports?: {} | undefined;
|
|
14
|
-
bindings?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
export type GuiProviderProps = typeof __propDef.props;
|
|
17
|
-
export type GuiProviderEvents = typeof __propDef.events;
|
|
18
|
-
export type GuiProviderSlots = typeof __propDef.slots;
|
|
19
|
-
export default class GuiProvider extends SvelteComponent<GuiProviderProps, GuiProviderEvents, GuiProviderSlots> {
|
|
20
|
-
}
|
|
21
|
-
export {};
|