@rainlanguage/ui-components 0.0.1-alpha.21 → 0.0.1-alpha.210
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 +25 -15
- 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 +184 -80
- package/dist/components/detail/OrderDetail.svelte.d.ts +21 -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 +200 -108
- package/dist/components/tables/OrdersListTable.svelte.d.ts +17 -21
- 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 +235 -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 +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 +66 -21
- package/dist/types/transaction.js +31 -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 -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/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
|
@@ -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,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,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 {};
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type { Hex } from 'viem';
|
|
2
|
-
import type { Config } from '@wagmi/core';
|
|
3
|
-
import type { ApprovalCalldata, DepositCalldataResult, RemoveOrderCalldata, SgVault, WithdrawCalldataResult, DepositAndAddOrderCalldataResult } from '@rainlanguage/orderbook/js_api';
|
|
4
|
-
export declare const ADDRESS_ZERO = "0x0000000000000000000000000000000000000000";
|
|
5
|
-
export declare const ONE: bigint;
|
|
6
|
-
export declare enum TransactionStatus {
|
|
7
|
-
IDLE = "Idle",
|
|
8
|
-
CHECKING_ALLOWANCE = "Checking your allowance...",
|
|
9
|
-
PENDING_WALLET = "Waiting for wallet confirmation...",
|
|
10
|
-
PENDING_APPROVAL = "Approving token spend...",
|
|
11
|
-
PENDING_DEPLOYMENT = "Deploying your order...",
|
|
12
|
-
PENDING_WITHDRAWAL = "Withdrawing tokens...",
|
|
13
|
-
PENDING_DEPOSIT = "Depositing tokens...",
|
|
14
|
-
PENDING_REMOVE_ORDER = "Removing order...",
|
|
15
|
-
PENDING_SUBGRAPH = "Awaiting subgraph...",
|
|
16
|
-
SUCCESS = "Success! Transaction confirmed",
|
|
17
|
-
ERROR = "Something went wrong"
|
|
18
|
-
}
|
|
19
|
-
export declare enum TransactionErrorMessage {
|
|
20
|
-
BAD_CALLLDATA = "Bad calldata.",
|
|
21
|
-
DEPLOY_FAILED = "Lock transaction failed.",
|
|
22
|
-
TIMEOUT = "Transaction timed out.",
|
|
23
|
-
APPROVAL_FAILED = "Approval transaction failed.",
|
|
24
|
-
USER_REJECTED_APPROVAL = "User rejected approval transaction.",
|
|
25
|
-
USER_REJECTED_TRANSACTION = "User rejected the transaction.",
|
|
26
|
-
DEPLOYMENT_FAILED = "Deployment transaction failed.",
|
|
27
|
-
SWITCH_CHAIN_FAILED = "Failed to switch chain.",
|
|
28
|
-
DEPOSIT_FAILED = "Failed to deposit tokens.",
|
|
29
|
-
WITHDRAWAL_FAILED = "Failed to withdraw tokens.",
|
|
30
|
-
REMOVE_ORDER_FAILED = "Failed to remove order."
|
|
31
|
-
}
|
|
32
|
-
export type ExtendedApprovalCalldata = ApprovalCalldata & {
|
|
33
|
-
symbol?: string;
|
|
34
|
-
};
|
|
35
|
-
export type DeploymentTransactionArgs = {
|
|
36
|
-
config: Config;
|
|
37
|
-
approvals: ExtendedApprovalCalldata[];
|
|
38
|
-
deploymentCalldata: DepositAndAddOrderCalldataResult;
|
|
39
|
-
orderbookAddress: Hex;
|
|
40
|
-
chainId: number;
|
|
41
|
-
subgraphUrl: string;
|
|
42
|
-
network: string;
|
|
43
|
-
};
|
|
44
|
-
export type DepositOrWithdrawTransactionArgs = {
|
|
45
|
-
config: Config;
|
|
46
|
-
approvalCalldata?: ApprovalCalldata;
|
|
47
|
-
transactionCalldata: DepositCalldataResult | WithdrawCalldataResult;
|
|
48
|
-
action: 'deposit' | 'withdraw';
|
|
49
|
-
chainId: number;
|
|
50
|
-
vault: SgVault;
|
|
51
|
-
subgraphUrl: string;
|
|
52
|
-
};
|
|
53
|
-
export type RemoveOrderTransactionArgs = {
|
|
54
|
-
config: Config;
|
|
55
|
-
orderbookAddress: Hex;
|
|
56
|
-
removeOrderCalldata: RemoveOrderCalldata;
|
|
57
|
-
chainId: number;
|
|
58
|
-
subgraphUrl: string;
|
|
59
|
-
};
|
|
60
|
-
export type TransactionState = {
|
|
61
|
-
status: TransactionStatus;
|
|
62
|
-
error: string;
|
|
63
|
-
hash: string;
|
|
64
|
-
data: null;
|
|
65
|
-
functionName: string;
|
|
66
|
-
message: string;
|
|
67
|
-
newOrderHash: string;
|
|
68
|
-
network: string;
|
|
69
|
-
explorerLink: string;
|
|
70
|
-
};
|
|
71
|
-
export type TransactionStore = {
|
|
72
|
-
subscribe: (run: (value: TransactionState) => void) => () => void;
|
|
73
|
-
reset: () => void;
|
|
74
|
-
handleDeploymentTransaction: (args: DeploymentTransactionArgs) => Promise<void>;
|
|
75
|
-
handleDepositOrWithdrawTransaction: (args: DepositOrWithdrawTransactionArgs) => Promise<void>;
|
|
76
|
-
handleRemoveOrderTransaction: (args: RemoveOrderTransactionArgs) => Promise<void>;
|
|
77
|
-
checkingWalletAllowance: (message?: string) => void;
|
|
78
|
-
awaitWalletConfirmation: (message?: string) => void;
|
|
79
|
-
awaitApprovalTx: (hash: string) => void;
|
|
80
|
-
transactionSuccess: (hash: string, message?: string) => void;
|
|
81
|
-
transactionError: (message: TransactionErrorMessage, hash?: string) => void;
|
|
82
|
-
};
|
|
83
|
-
declare const _default: {
|
|
84
|
-
subscribe: (this: void, run: import("svelte/store").Subscriber<TransactionState>, invalidate?: import("svelte/store").Invalidator<TransactionState> | undefined) => import("svelte/store").Unsubscriber;
|
|
85
|
-
reset: () => void;
|
|
86
|
-
handleDeploymentTransaction: ({ config, approvals, deploymentCalldata, orderbookAddress, chainId, subgraphUrl, network }: DeploymentTransactionArgs) => Promise<void>;
|
|
87
|
-
handleDepositOrWithdrawTransaction: ({ config, approvalCalldata, transactionCalldata, action, chainId, vault, subgraphUrl }: DepositOrWithdrawTransactionArgs) => Promise<void>;
|
|
88
|
-
handleRemoveOrderTransaction: ({ config, orderbookAddress, removeOrderCalldata, chainId, subgraphUrl }: RemoveOrderTransactionArgs) => Promise<void>;
|
|
89
|
-
checkingWalletAllowance: (message?: string) => void;
|
|
90
|
-
awaitWalletConfirmation: (message?: string) => void;
|
|
91
|
-
awaitApprovalTx: (hash: string, symbol: string | undefined) => void;
|
|
92
|
-
transactionSuccess: (hash: string, message?: string, newOrderHash?: string, network?: string) => void;
|
|
93
|
-
transactionError: (message: TransactionErrorMessage, hash?: string) => void;
|
|
94
|
-
awaitTransactionIndexing: (subgraphUrl: string, txHash: string, successMessage: string) => Promise<void>;
|
|
95
|
-
awaitNewOrderIndexing: (subgraphUrl: string, txHash: string, network?: string) => Promise<void>;
|
|
96
|
-
awaitRemoveOrderIndexing: (subgraphUrl: string, txHash: string) => Promise<void>;
|
|
97
|
-
};
|
|
98
|
-
export default _default;
|