@rainlanguage/ui-components 0.0.1-alpha.10
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 +58 -0
- package/dist/__fixtures__/orderDetail.d.ts +99 -0
- package/dist/__fixtures__/orderDetail.js +204 -0
- package/dist/__fixtures__/settings-12-11-24.json +160 -0
- package/dist/__mocks__/MockComponent.d.ts +1 -0
- package/dist/__mocks__/MockComponent.js +2 -0
- package/dist/__mocks__/MockComponent.svelte +3 -0
- package/dist/__mocks__/MockComponent.svelte.d.ts +18 -0
- package/dist/__mocks__/mockTransactionStore.d.ts +22 -0
- package/dist/__mocks__/mockTransactionStore.js +56 -0
- package/dist/__mocks__/mockWeb3Config.d.ts +2 -0
- package/dist/__mocks__/mockWeb3Config.js +15 -0
- package/dist/__mocks__/queries.d.ts +13 -0
- package/dist/__mocks__/queries.js +64 -0
- package/dist/__mocks__/settings.d.ts +3 -0
- package/dist/__mocks__/settings.js +37 -0
- package/dist/__mocks__/stores.d.ts +94 -0
- package/dist/__mocks__/stores.js +113 -0
- package/dist/app.css +3 -0
- package/dist/assets/ledger.svg +6 -0
- package/dist/assets/logo-dark.svg +15 -0
- package/dist/assets/logo-light.svg +15 -0
- package/dist/assets/walletconnect.svg +1 -0
- package/dist/components/BadgeActive.svelte +9 -0
- package/dist/components/BadgeActive.svelte.d.ts +19 -0
- package/dist/components/BlockQuote.svelte +1 -0
- package/dist/components/BlockQuote.svelte.d.ts +29 -0
- package/dist/components/ButtonDarkMode.svelte +14 -0
- package/dist/components/ButtonDarkMode.svelte.d.ts +18 -0
- package/dist/components/ButtonLoading.svelte +11 -0
- package/dist/components/ButtonLoading.svelte.d.ts +24 -0
- package/dist/components/ButtonTab.svelte +7 -0
- package/dist/components/ButtonTab.svelte.d.ts +23 -0
- package/dist/components/ButtonVaultLink.svelte +29 -0
- package/dist/components/ButtonVaultLink.svelte.d.ts +22 -0
- package/dist/components/CardProperty.svelte +11 -0
- package/dist/components/CardProperty.svelte.d.ts +31 -0
- package/dist/components/CheckboxMyItemsOnly.svelte +23 -0
- package/dist/components/CheckboxMyItemsOnly.svelte.d.ts +21 -0
- package/dist/components/CheckboxZeroBalanceVault.svelte +20 -0
- package/dist/components/CheckboxZeroBalanceVault.svelte.d.ts +19 -0
- package/dist/components/CodeMirrorDotrain.svelte +35 -0
- package/dist/components/CodeMirrorDotrain.svelte.d.ts +23 -0
- package/dist/components/CodeMirrorRainlang.svelte +34 -0
- package/dist/components/CodeMirrorRainlang.svelte.d.ts +23 -0
- package/dist/components/DropdownProperty.svelte +12 -0
- package/dist/components/DropdownProperty.svelte.d.ts +19 -0
- package/dist/components/EditableSpan.svelte +46 -0
- package/dist/components/EditableSpan.svelte.d.ts +21 -0
- package/dist/components/Hash.svelte +85 -0
- package/dist/components/Hash.svelte.d.ts +28 -0
- package/dist/components/Heading.svelte +19 -0
- package/dist/components/Heading.svelte.d.ts +29 -0
- package/dist/components/IconError.svelte +8 -0
- package/dist/components/IconError.svelte.d.ts +16 -0
- package/dist/components/IconExternalLink.svelte +18 -0
- package/dist/components/IconExternalLink.svelte.d.ts +18 -0
- package/dist/components/IconInfo.svelte +8 -0
- package/dist/components/IconInfo.svelte.d.ts +16 -0
- package/dist/components/IconLedger.svelte +13 -0
- package/dist/components/IconLedger.svelte.d.ts +16 -0
- package/dist/components/IconSuccess.svelte +8 -0
- package/dist/components/IconSuccess.svelte.d.ts +16 -0
- package/dist/components/IconTelegram.svelte +12 -0
- package/dist/components/IconTelegram.svelte.d.ts +25 -0
- package/dist/components/IconWalletConnect.svelte +13 -0
- package/dist/components/IconWalletConnect.svelte.d.ts +16 -0
- package/dist/components/IconWarning.svelte +8 -0
- package/dist/components/IconWarning.svelte.d.ts +16 -0
- package/dist/components/License.svelte +29 -0
- package/dist/components/License.svelte.d.ts +25 -0
- package/dist/components/ListViewOrderbookFilters.svelte +58 -0
- package/dist/components/ListViewOrderbookFilters.svelte.d.ts +28 -0
- package/dist/components/OrderOrVaultHash.svelte +24 -0
- package/dist/components/OrderOrVaultHash.svelte.d.ts +22 -0
- package/dist/components/PageHeader.svelte +33 -0
- package/dist/components/PageHeader.svelte.d.ts +21 -0
- package/dist/components/TanstackAppTable.svelte +73 -0
- package/dist/components/TanstackAppTable.svelte.d.ts +30 -0
- package/dist/components/Text.svelte +12 -0
- package/dist/components/Text.svelte.d.ts +31 -0
- package/dist/components/charts/APYTimeFilters.svelte +47 -0
- package/dist/components/charts/APYTimeFilters.svelte.d.ts +19 -0
- package/dist/components/charts/ChartTimeFilters.svelte +35 -0
- package/dist/components/charts/ChartTimeFilters.svelte.d.ts +18 -0
- package/dist/components/charts/LightweightChart.svelte +110 -0
- package/dist/components/charts/LightweightChart.svelte.d.ts +29 -0
- package/dist/components/charts/OrderTradesChart.svelte +36 -0
- package/dist/components/charts/OrderTradesChart.svelte.d.ts +21 -0
- package/dist/components/charts/TableTimeFilters.svelte +48 -0
- package/dist/components/charts/TableTimeFilters.svelte.d.ts +19 -0
- package/dist/components/charts/TanstackLightweightChartLine.svelte +24 -0
- package/dist/components/charts/TanstackLightweightChartLine.svelte.d.ts +23 -0
- package/dist/components/charts/VaultBalanceChart.svelte +37 -0
- package/dist/components/charts/VaultBalanceChart.svelte.d.ts +22 -0
- package/dist/components/checkbox/Checkbox.svelte +17 -0
- package/dist/components/checkbox/Checkbox.svelte.d.ts +21 -0
- package/dist/components/deployment/ButtonSelectOption.svelte +14 -0
- package/dist/components/deployment/ButtonSelectOption.svelte.d.ts +20 -0
- package/dist/components/deployment/ComposedRainlangModal.svelte +35 -0
- package/dist/components/deployment/ComposedRainlangModal.svelte.d.ts +19 -0
- package/dist/components/deployment/DeploymentSectionHeader.svelte +14 -0
- package/dist/components/deployment/DeploymentSectionHeader.svelte.d.ts +19 -0
- package/dist/components/deployment/DeploymentSteps.svelte +252 -0
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +38 -0
- package/dist/components/deployment/DeploymentTile.svelte +19 -0
- package/dist/components/deployment/DeploymentTile.svelte.d.ts +21 -0
- package/dist/components/deployment/DeploymentsSection.svelte +20 -0
- package/dist/components/deployment/DeploymentsSection.svelte.d.ts +19 -0
- package/dist/components/deployment/DepositInput.svelte +93 -0
- package/dist/components/deployment/DepositInput.svelte.d.ts +20 -0
- package/dist/components/deployment/DepositsSection.svelte +8 -0
- package/dist/components/deployment/DepositsSection.svelte.d.ts +20 -0
- package/dist/components/deployment/DisclaimerModal.svelte +54 -0
- package/dist/components/deployment/DisclaimerModal.svelte.d.ts +19 -0
- package/dist/components/deployment/FieldDefinitionInput.svelte +66 -0
- package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +20 -0
- package/dist/components/deployment/FieldDefinitionsSection.svelte +9 -0
- package/dist/components/deployment/FieldDefinitionsSection.svelte.d.ts +20 -0
- package/dist/components/deployment/InvalidStrategiesSection.svelte +19 -0
- package/dist/components/deployment/InvalidStrategiesSection.svelte.d.ts +19 -0
- package/dist/components/deployment/SelectToken.svelte +88 -0
- package/dist/components/deployment/SelectToken.svelte.d.ts +21 -0
- package/dist/components/deployment/SelectTokensSection.svelte +17 -0
- package/dist/components/deployment/SelectTokensSection.svelte.d.ts +21 -0
- package/dist/components/deployment/ShareChoicesButton.svelte +26 -0
- package/dist/components/deployment/ShareChoicesButton.svelte.d.ts +18 -0
- package/dist/components/deployment/StrategyPage.svelte +70 -0
- package/dist/components/deployment/StrategyPage.svelte.d.ts +19 -0
- package/dist/components/deployment/TokenIOInput.svelte +62 -0
- package/dist/components/deployment/TokenIOInput.svelte.d.ts +22 -0
- package/dist/components/deployment/TokenIOSection.svelte +17 -0
- package/dist/components/deployment/TokenIOSection.svelte.d.ts +21 -0
- package/dist/components/deployment/ValidStrategiesSection.svelte +25 -0
- package/dist/components/deployment/ValidStrategiesSection.svelte.d.ts +19 -0
- package/dist/components/deployment/getDeploymentTransactionArgs.d.ts +17 -0
- package/dist/components/deployment/getDeploymentTransactionArgs.js +24 -0
- package/dist/components/detail/DepositOrWithdrawButtons.svelte +44 -0
- package/dist/components/detail/DepositOrWithdrawButtons.svelte.d.ts +26 -0
- package/dist/components/detail/OrderDetail.svelte +195 -0
- package/dist/components/detail/OrderDetail.svelte.d.ts +36 -0
- package/dist/components/detail/TanstackOrderQuote.svelte +173 -0
- package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +22 -0
- package/dist/components/detail/TanstackPageContentDetail.svelte +56 -0
- package/dist/components/detail/TanstackPageContentDetail.svelte.d.ts +31 -0
- package/dist/components/detail/VaultDetail.svelte +178 -0
- package/dist/components/detail/VaultDetail.svelte.d.ts +35 -0
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte +38 -0
- package/dist/components/dropdown/DropdownActiveSubgraphs.svelte.d.ts +21 -0
- package/dist/components/dropdown/DropdownCheckbox.svelte +77 -0
- package/dist/components/dropdown/DropdownCheckbox.svelte.d.ts +26 -0
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte +15 -0
- package/dist/components/dropdown/DropdownOrderListAccounts.svelte.d.ts +20 -0
- package/dist/components/dropdown/DropdownOrderStatus.svelte +31 -0
- package/dist/components/dropdown/DropdownOrderStatus.svelte.d.ts +19 -0
- package/dist/components/dropdown/DropdownRadio.svelte +45 -0
- package/dist/components/dropdown/DropdownRadio.svelte.d.ts +30 -0
- package/dist/components/icon/RainLogo.svelte +54 -0
- package/dist/components/icon/RainLogo.svelte.d.ts +25 -0
- package/dist/components/icon/Refresh.svelte +57 -0
- package/dist/components/icon/Refresh.svelte.d.ts +40 -0
- package/dist/components/input/InputHex.svelte +42 -0
- package/dist/components/input/InputHex.svelte.d.ts +19 -0
- package/dist/components/input/InputOrderHash.svelte +22 -0
- package/dist/components/input/InputOrderHash.svelte.d.ts +20 -0
- package/dist/components/input/InputRegistryUrl.svelte +18 -0
- package/dist/components/input/InputRegistryUrl.svelte.d.ts +16 -0
- package/dist/components/input/InputToken.svelte +53 -0
- package/dist/components/input/InputToken.svelte.d.ts +19 -0
- package/dist/components/input/InputTokenAmount.svelte +63 -0
- package/dist/components/input/InputTokenAmount.svelte.d.ts +21 -0
- package/dist/components/tables/OrderAPY.svelte +57 -0
- package/dist/components/tables/OrderAPY.svelte.d.ts +19 -0
- package/dist/components/tables/OrderTradesListTable.svelte +145 -0
- package/dist/components/tables/OrderTradesListTable.svelte.d.ts +21 -0
- package/dist/components/tables/OrderVaultsVolTable.svelte +67 -0
- package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +19 -0
- package/dist/components/tables/OrdersListTable.svelte +181 -0
- package/dist/components/tables/OrdersListTable.svelte.d.ts +35 -0
- package/dist/components/tables/VaultBalanceChangesTable.svelte +74 -0
- package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +17 -0
- package/dist/components/tables/VaultsListTable.svelte +229 -0
- package/dist/components/tables/VaultsListTable.svelte.d.ts +40 -0
- package/dist/components/wallet/WalletConnect.svelte +28 -0
- package/dist/components/wallet/WalletConnect.svelte.d.ts +23 -0
- package/dist/errors/DeploymentStepsError.d.ts +24 -0
- package/dist/errors/DeploymentStepsError.js +45 -0
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.js +1 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.js +89 -0
- package/dist/queries/constants.d.ts +2 -0
- package/dist/queries/constants.js +2 -0
- package/dist/queries/keys.d.ts +9 -0
- package/dist/queries/keys.js +9 -0
- package/dist/queries/queryClient.d.ts +3 -0
- package/dist/queries/queryClient.js +16 -0
- package/dist/services/getExplorerLink.d.ts +1 -0
- package/dist/services/getExplorerLink.js +10 -0
- package/dist/services/handleShareChoices.d.ts +2 -0
- package/dist/services/handleShareChoices.js +10 -0
- package/dist/services/historicalOrderCharts.d.ts +12 -0
- package/dist/services/historicalOrderCharts.js +496 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +1 -0
- package/dist/services/registry.d.ts +25 -0
- package/dist/services/registry.js +133 -0
- package/dist/services/time.d.ts +6 -0
- package/dist/services/time.js +17 -0
- package/dist/stores/transactionStore.d.ts +98 -0
- package/dist/stores/transactionStore.js +303 -0
- package/dist/test/matchers.d.ts +6 -0
- package/dist/test/matchers.js +4 -0
- package/dist/types/appStores.d.ts +19 -0
- package/dist/types/appStores.js +1 -0
- package/dist/types/modal.d.ts +20 -0
- package/dist/types/modal.js +1 -0
- package/dist/types/strategy.d.ts +10 -0
- package/dist/types/strategy.js +1 -0
- package/dist/types/transaction.d.ts +27 -0
- package/dist/types/transaction.js +1 -0
- package/dist/utils/breadcrumbs.d.ts +5 -0
- package/dist/utils/breadcrumbs.js +9 -0
- package/dist/utils/codeMirrorThemes.d.ts +2 -0
- package/dist/utils/codeMirrorThemes.js +86 -0
- package/dist/utils/hex.d.ts +2 -0
- package/dist/utils/hex.js +3 -0
- package/dist/utils/lightweightChartsThemes.d.ts +52 -0
- package/dist/utils/lightweightChartsThemes.js +21 -0
- package/dist/utils/number.d.ts +14 -0
- package/dist/utils/number.js +43 -0
- package/dist/utils/time.d.ts +12 -0
- package/dist/utils/time.js +27 -0
- package/dist/utils/vault.d.ts +2 -0
- package/dist/utils/vault.js +29 -0
- package/package.json +86 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script>import { getContext } from "svelte";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
const ctx = getContext("iconCtx") ?? {};
|
|
4
|
+
const sizes = {
|
|
5
|
+
xs: "w-3 h-3",
|
|
6
|
+
sm: "w-4 h-4",
|
|
7
|
+
md: "w-5 h-5",
|
|
8
|
+
lg: "w-6 h-6",
|
|
9
|
+
xl: "w-8 h-8"
|
|
10
|
+
};
|
|
11
|
+
export let size = ctx.size || "md";
|
|
12
|
+
export let role = ctx.role || "img";
|
|
13
|
+
export let ariaLabel = "refresh";
|
|
14
|
+
export let spin = false;
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<svg
|
|
18
|
+
data-testid="refresh-button"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
fill="none"
|
|
21
|
+
{...$$restProps}
|
|
22
|
+
class={twMerge(
|
|
23
|
+
'shrink-0 cursor-pointer outline-none',
|
|
24
|
+
sizes[size],
|
|
25
|
+
$$props.class,
|
|
26
|
+
spin ? 'animate-spin ease-out' : ''
|
|
27
|
+
)}
|
|
28
|
+
{role}
|
|
29
|
+
aria-label={ariaLabel}
|
|
30
|
+
viewBox="0 0 24 24"
|
|
31
|
+
on:click
|
|
32
|
+
on:keydown
|
|
33
|
+
on:keyup
|
|
34
|
+
on:focus
|
|
35
|
+
on:blur
|
|
36
|
+
on:mouseenter
|
|
37
|
+
on:mouseleave
|
|
38
|
+
on:mouseover
|
|
39
|
+
on:mouseout
|
|
40
|
+
>
|
|
41
|
+
<path
|
|
42
|
+
stroke="currentColor"
|
|
43
|
+
stroke-linecap="round"
|
|
44
|
+
stroke-linejoin="round"
|
|
45
|
+
stroke-width="2"
|
|
46
|
+
d="M17.651 7.65a7.131 7.131 0 0 0-12.68 3.15M18.001 4v4h-4m-7.652 8.35a7.13 7.13 0 0 0 12.68-3.15M6 20v-4h4"
|
|
47
|
+
/>
|
|
48
|
+
</svg>
|
|
49
|
+
|
|
50
|
+
<!--
|
|
51
|
+
@component
|
|
52
|
+
[Go to docs](https://flowbite-svelte-icons.vercel.app/)
|
|
53
|
+
## Props
|
|
54
|
+
@prop export let size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = ctx.size || 'md';
|
|
55
|
+
@prop export let role = ctx.role || 'img';
|
|
56
|
+
@prop export let ariaLabel = 'refresh';
|
|
57
|
+
-->
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { AriaRole } from 'svelte/elements';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
size?: ("xs" | "sm" | "md" | "lg" | "xl") | undefined;
|
|
7
|
+
role?: AriaRole | undefined;
|
|
8
|
+
ariaLabel?: string | undefined;
|
|
9
|
+
spin?: boolean | undefined;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
click: MouseEvent;
|
|
13
|
+
keydown: KeyboardEvent;
|
|
14
|
+
keyup: KeyboardEvent;
|
|
15
|
+
focus: FocusEvent;
|
|
16
|
+
blur: FocusEvent;
|
|
17
|
+
mouseenter: MouseEvent;
|
|
18
|
+
mouseleave: MouseEvent;
|
|
19
|
+
mouseover: MouseEvent;
|
|
20
|
+
mouseout: MouseEvent;
|
|
21
|
+
} & {
|
|
22
|
+
[evt: string]: CustomEvent<any>;
|
|
23
|
+
};
|
|
24
|
+
slots: {};
|
|
25
|
+
exports?: undefined;
|
|
26
|
+
bindings?: undefined;
|
|
27
|
+
};
|
|
28
|
+
export type RefreshProps = typeof __propDef.props;
|
|
29
|
+
export type RefreshEvents = typeof __propDef.events;
|
|
30
|
+
export type RefreshSlots = typeof __propDef.slots;
|
|
31
|
+
/**
|
|
32
|
+
* [Go to docs](https://flowbite-svelte-icons.vercel.app/)
|
|
33
|
+
* ## Props
|
|
34
|
+
* @prop export let size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = ctx.size || 'md';
|
|
35
|
+
* @prop export let role = ctx.role || 'img';
|
|
36
|
+
* @prop export let ariaLabel = 'refresh';
|
|
37
|
+
*/
|
|
38
|
+
export default class Refresh extends SvelteComponent<RefreshProps, RefreshEvents, RefreshSlots> {
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script>import { imask } from "@imask/svelte";
|
|
2
|
+
import { fromHex, toHex } from "viem";
|
|
3
|
+
import { HEX_INPUT_REGEX } from "../../utils/hex";
|
|
4
|
+
let valueRaw = "";
|
|
5
|
+
export let value;
|
|
6
|
+
export let required = true;
|
|
7
|
+
$: {
|
|
8
|
+
if (value !== void 0) {
|
|
9
|
+
valueRaw = toHex(value);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
const maskOptions = {
|
|
13
|
+
// hexadecimal string, optionally starting with 0x
|
|
14
|
+
mask: HEX_INPUT_REGEX,
|
|
15
|
+
lazy: false
|
|
16
|
+
};
|
|
17
|
+
function complete({ detail }) {
|
|
18
|
+
valueRaw = detail.value;
|
|
19
|
+
if (detail.unmaskedValue.length === 0) {
|
|
20
|
+
value = 0n;
|
|
21
|
+
} else {
|
|
22
|
+
let valuePrefixed = detail.unmaskedValue;
|
|
23
|
+
if (detail.unmaskedValue.substring(0, 2) !== "0x") {
|
|
24
|
+
valuePrefixed = `0x${valuePrefixed}`;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
value = fromHex(valuePrefixed, "bigint");
|
|
28
|
+
} catch (e) {
|
|
29
|
+
value = 0n;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<input
|
|
36
|
+
{required}
|
|
37
|
+
type="text"
|
|
38
|
+
value={valueRaw}
|
|
39
|
+
class="focus:border-primary-500 focus:ring-primary-500 dark:focus:border-primary-500 dark:focus:ring-primary-500 block w-full rounded-lg border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right dark:border-gray-500 dark:bg-gray-600 dark:text-white dark:placeholder-gray-400"
|
|
40
|
+
use:imask={maskOptions}
|
|
41
|
+
on:complete={complete}
|
|
42
|
+
/>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
value: bigint | undefined;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type InputHexProps = typeof __propDef.props;
|
|
15
|
+
export type InputHexEvents = typeof __propDef.events;
|
|
16
|
+
export type InputHexSlots = typeof __propDef.slots;
|
|
17
|
+
export default class InputHex extends SvelteComponent<InputHexProps, InputHexEvents, InputHexSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>import { Label } from "flowbite-svelte";
|
|
2
|
+
export let orderHash;
|
|
3
|
+
export let value = $orderHash;
|
|
4
|
+
function handleChange(event) {
|
|
5
|
+
const input = event.target;
|
|
6
|
+
value = input.value;
|
|
7
|
+
$orderHash = value;
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div data-testid="order-hash-input" class="flex flex-col gap-x-2">
|
|
12
|
+
<Label>Order Hash</Label>
|
|
13
|
+
<div class="w-full lg:w-32">
|
|
14
|
+
<input
|
|
15
|
+
type="text"
|
|
16
|
+
bind:value
|
|
17
|
+
on:input={handleChange}
|
|
18
|
+
placeholder="0x..."
|
|
19
|
+
class="focus:border-primary-500 focus:ring-primary-500 dark:focus:border-primary-500 dark:focus:ring-primary-500 block w-full rounded-lg border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right dark:border-gray-500 dark:bg-gray-600 dark:text-white dark:placeholder-gray-400"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Writable } from 'svelte/store';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
orderHash: Writable<string>;
|
|
6
|
+
value?: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
exports?: {} | undefined;
|
|
13
|
+
bindings?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
export type InputOrderHashProps = typeof __propDef.props;
|
|
16
|
+
export type InputOrderHashEvents = typeof __propDef.events;
|
|
17
|
+
export type InputOrderHashSlots = typeof __propDef.slots;
|
|
18
|
+
export default class InputOrderHash extends SvelteComponent<InputOrderHashProps, InputOrderHashEvents, InputOrderHashSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>import { Button, Input } from "flowbite-svelte";
|
|
2
|
+
let newRegistryUrl = localStorage.getItem("registry") || "";
|
|
3
|
+
const loadRegistryUrl = () => {
|
|
4
|
+
window.history.pushState({}, "", window.location.pathname + "?registry=" + newRegistryUrl);
|
|
5
|
+
window.location.reload();
|
|
6
|
+
localStorage.setItem("registry", newRegistryUrl);
|
|
7
|
+
};
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div class="flex w-full items-start gap-4">
|
|
11
|
+
<Input
|
|
12
|
+
id="strategy-url"
|
|
13
|
+
type="url"
|
|
14
|
+
placeholder="Enter URL to raw strategy registry file"
|
|
15
|
+
bind:value={newRegistryUrl}
|
|
16
|
+
/>
|
|
17
|
+
<Button class="text-nowrap" on:click={loadRegistryUrl}>Load Registry URL</Button>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
exports?: {} | undefined;
|
|
9
|
+
bindings?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
export type InputRegistryUrlProps = typeof __propDef.props;
|
|
12
|
+
export type InputRegistryUrlEvents = typeof __propDef.events;
|
|
13
|
+
export type InputRegistryUrlSlots = typeof __propDef.slots;
|
|
14
|
+
export default class InputRegistryUrl extends SvelteComponent<InputRegistryUrlProps, InputRegistryUrlEvents, InputRegistryUrlSlots> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script>import { Helper, Input } from "flowbite-svelte";
|
|
2
|
+
import { imask } from "@imask/svelte";
|
|
3
|
+
import { isAddress } from "viem";
|
|
4
|
+
let decimalsRaw = "";
|
|
5
|
+
export let decimals;
|
|
6
|
+
export let address = "";
|
|
7
|
+
$: isAddressValid = address && address.length > 0 && isAddress(address);
|
|
8
|
+
$: {
|
|
9
|
+
if (decimals !== void 0) {
|
|
10
|
+
decimalsRaw = decimals.toString();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const decimalsMaskOptions = {
|
|
14
|
+
mask: Number,
|
|
15
|
+
min: 0,
|
|
16
|
+
lazy: false,
|
|
17
|
+
scale: 0,
|
|
18
|
+
thousandsSeparator: "",
|
|
19
|
+
radix: "."
|
|
20
|
+
};
|
|
21
|
+
function decimalsComplete({ detail }) {
|
|
22
|
+
decimalsRaw = detail.value;
|
|
23
|
+
if (detail.unmaskedValue.length === 0) {
|
|
24
|
+
decimals = 0;
|
|
25
|
+
} else {
|
|
26
|
+
decimals = parseInt(detail.unmaskedValue);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div class="flex w-full items-start justify-start space-x-2">
|
|
32
|
+
<div class="grow" data-testid="token-address">
|
|
33
|
+
<div class="relative flex">
|
|
34
|
+
<Input label="Token Address" name="address" required bind:value={address} />
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
{#if !isAddressValid && address.length > 0}
|
|
38
|
+
<Helper class="mt-2 text-sm" color="red">Invalid Address</Helper>
|
|
39
|
+
{/if}
|
|
40
|
+
|
|
41
|
+
<Helper class="mt-2 text-sm">Token Address</Helper>
|
|
42
|
+
</div>
|
|
43
|
+
<div class="w-32 grow-0 break-all" data-testid="token-decimals-input">
|
|
44
|
+
<input
|
|
45
|
+
type="text"
|
|
46
|
+
value={decimalsRaw}
|
|
47
|
+
class="focus:border-primary-500 focus:ring-primary-500 dark:focus:border-primary-500 dark:focus:ring-primary-500 block w-full rounded-lg border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right dark:border-gray-500 dark:bg-gray-600 dark:text-white dark:placeholder-gray-400"
|
|
48
|
+
use:imask={decimalsMaskOptions}
|
|
49
|
+
on:complete={decimalsComplete}
|
|
50
|
+
/>
|
|
51
|
+
<Helper class="break-word mt-2 text-sm">Decimals</Helper>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
decimals: number | undefined;
|
|
5
|
+
address?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type InputTokenProps = typeof __propDef.props;
|
|
15
|
+
export type InputTokenEvents = typeof __propDef.events;
|
|
16
|
+
export type InputTokenSlots = typeof __propDef.slots;
|
|
17
|
+
export default class InputToken extends SvelteComponent<InputTokenProps, InputTokenEvents, InputTokenSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script>import { InputAddon, Button, Alert } from "flowbite-svelte";
|
|
2
|
+
import { InfoCircleSolid } from "flowbite-svelte-icons";
|
|
3
|
+
import { parseUnits } from "viem";
|
|
4
|
+
export let symbol = void 0;
|
|
5
|
+
export let decimals = 0;
|
|
6
|
+
export let maxValue = void 0;
|
|
7
|
+
let inputValue = "";
|
|
8
|
+
export let value = 0n;
|
|
9
|
+
function handleInput(event) {
|
|
10
|
+
const input = event.target;
|
|
11
|
+
inputValue = input.value;
|
|
12
|
+
if (inputValue === "") {
|
|
13
|
+
value = 0n;
|
|
14
|
+
} else {
|
|
15
|
+
try {
|
|
16
|
+
value = parseUnits(inputValue, decimals);
|
|
17
|
+
} catch (_e) {
|
|
18
|
+
value = 0n;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function fillMaxValue() {
|
|
23
|
+
if (!maxValue) return;
|
|
24
|
+
value = maxValue;
|
|
25
|
+
inputValue = maxValue.toString().padStart(decimals + 1, "0");
|
|
26
|
+
inputValue = inputValue.slice(0, -decimals) + "." + inputValue.slice(-decimals);
|
|
27
|
+
inputValue = inputValue.replace(/\.?0+$/, "");
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div class="w-full">
|
|
32
|
+
<div class="flex w-full">
|
|
33
|
+
<div class="relative flex w-full">
|
|
34
|
+
<input
|
|
35
|
+
type="text"
|
|
36
|
+
class={`focus:border-primary-500 focus:ring-primary-500 dark:focus:border-primary-500 dark:focus:ring-primary-500 block w-full rounded-lg border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 disabled:cursor-not-allowed disabled:opacity-50 rtl:text-right dark:border-gray-500 dark:bg-gray-600 dark:text-white dark:placeholder-gray-400 ${symbol && '!rounded-none !rounded-l-lg'}`}
|
|
37
|
+
bind:value={inputValue}
|
|
38
|
+
on:input={handleInput}
|
|
39
|
+
/>
|
|
40
|
+
|
|
41
|
+
{#if maxValue}
|
|
42
|
+
<div class="absolute right-4 flex h-10 flex-col justify-center">
|
|
43
|
+
<Button color="blue" class="px-2 py-1" size="xs" pill on:click={fillMaxValue}>MAX</Button>
|
|
44
|
+
</div>
|
|
45
|
+
{/if}
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
{#if symbol}
|
|
49
|
+
<InputAddon>
|
|
50
|
+
<span class="whitespace-nowrap">
|
|
51
|
+
{symbol}
|
|
52
|
+
</span>
|
|
53
|
+
</InputAddon>
|
|
54
|
+
{/if}
|
|
55
|
+
</div>
|
|
56
|
+
{#if decimals === 0}
|
|
57
|
+
<Alert color="yellow" border class="mt-2">
|
|
58
|
+
<InfoCircleSolid slot="icon" class="h-6 w-6" />
|
|
59
|
+
This token does not specify a number of decimals. <br />You are inputting the raw integer
|
|
60
|
+
amount with 0 decimal places.
|
|
61
|
+
</Alert>
|
|
62
|
+
{/if}
|
|
63
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
symbol?: string | undefined;
|
|
5
|
+
decimals?: number;
|
|
6
|
+
maxValue?: bigint | undefined;
|
|
7
|
+
value?: bigint;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
exports?: {} | undefined;
|
|
14
|
+
bindings?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type InputTokenAmountProps = typeof __propDef.props;
|
|
17
|
+
export type InputTokenAmountEvents = typeof __propDef.events;
|
|
18
|
+
export type InputTokenAmountSlots = typeof __propDef.slots;
|
|
19
|
+
export default class InputTokenAmount extends SvelteComponent<InputTokenAmountProps, InputTokenAmountEvents, InputTokenAmountSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script>import { createInfiniteQuery } from "@tanstack/svelte-query";
|
|
2
|
+
import TanstackAppTable from "../TanstackAppTable.svelte";
|
|
3
|
+
import { QKEY_ORDER_APY } from "../../queries/keys";
|
|
4
|
+
import { getOrderPerformance } from "@rainlanguage/orderbook/js_api";
|
|
5
|
+
import { TableBodyCell, TableHeadCell } from "flowbite-svelte";
|
|
6
|
+
import ApyTimeFilters from "../charts/APYTimeFilters.svelte";
|
|
7
|
+
import { bigintStringToPercentage } from "../../utils/number";
|
|
8
|
+
export let id;
|
|
9
|
+
export let subgraphUrl;
|
|
10
|
+
let startTimestamp;
|
|
11
|
+
let endTimestamp;
|
|
12
|
+
$: queryStartTime = startTimestamp ? BigInt(startTimestamp) : void 0;
|
|
13
|
+
$: queryEndTime = endTimestamp ? BigInt(endTimestamp) : void 0;
|
|
14
|
+
$: orderPerformance = createInfiniteQuery({
|
|
15
|
+
queryKey: [id, QKEY_ORDER_APY + id],
|
|
16
|
+
queryFn: async () => {
|
|
17
|
+
return [
|
|
18
|
+
await getOrderPerformance(
|
|
19
|
+
subgraphUrl || "",
|
|
20
|
+
id,
|
|
21
|
+
queryStartTime,
|
|
22
|
+
queryEndTime
|
|
23
|
+
)
|
|
24
|
+
];
|
|
25
|
+
},
|
|
26
|
+
initialPageParam: 0,
|
|
27
|
+
getNextPageParam: () => void 0,
|
|
28
|
+
enabled: !!subgraphUrl
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<TanstackAppTable
|
|
33
|
+
query={orderPerformance}
|
|
34
|
+
emptyMessage="APY Unavailable"
|
|
35
|
+
rowHoverable={false}
|
|
36
|
+
queryKey={id}
|
|
37
|
+
>
|
|
38
|
+
<svelte:fragment slot="timeFilter">
|
|
39
|
+
<ApyTimeFilters bind:startTimestamp bind:endTimestamp />
|
|
40
|
+
</svelte:fragment>
|
|
41
|
+
<svelte:fragment slot="head">
|
|
42
|
+
<TableHeadCell padding="p-4">APY</TableHeadCell>
|
|
43
|
+
</svelte:fragment>
|
|
44
|
+
|
|
45
|
+
<svelte:fragment slot="bodyRow" let:item>
|
|
46
|
+
<TableBodyCell tdClass="break-all px-4 py-2" data-testid="apy-field">
|
|
47
|
+
{item.denominatedPerformance
|
|
48
|
+
? (item.denominatedPerformance.apyIsNeg ? '-' : '') +
|
|
49
|
+
bigintStringToPercentage(item.denominatedPerformance.apy, 18, 5) +
|
|
50
|
+
'% in ' +
|
|
51
|
+
(item.denominatedPerformance.token.symbol ??
|
|
52
|
+
item.denominatedPerformance.token.name ??
|
|
53
|
+
item.denominatedPerformance.token.address)
|
|
54
|
+
: 'Unavailable APY'}
|
|
55
|
+
</TableBodyCell>
|
|
56
|
+
</svelte:fragment>
|
|
57
|
+
</TanstackAppTable>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
id: string;
|
|
5
|
+
subgraphUrl: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
exports?: {} | undefined;
|
|
12
|
+
bindings?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export type OrderApyProps = typeof __propDef.props;
|
|
15
|
+
export type OrderApyEvents = typeof __propDef.events;
|
|
16
|
+
export type OrderApySlots = typeof __propDef.slots;
|
|
17
|
+
export default class OrderApy extends SvelteComponent<OrderApyProps, OrderApyEvents, OrderApySlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<script>import { createInfiniteQuery } from "@tanstack/svelte-query";
|
|
2
|
+
import TanstackAppTable from "../TanstackAppTable.svelte";
|
|
3
|
+
import { QKEY_ORDER_TRADES_LIST } from "../../queries/keys";
|
|
4
|
+
import { getOrderTradesList, getOrderTradesCount } from "@rainlanguage/orderbook/js_api";
|
|
5
|
+
import { DEFAULT_PAGE_SIZE } from "../../queries/constants";
|
|
6
|
+
import { TableBodyCell, TableHeadCell } from "flowbite-svelte";
|
|
7
|
+
import { formatTimestampSecondsAsLocal } from "../../utils/time";
|
|
8
|
+
import Hash, { HashType } from "../Hash.svelte";
|
|
9
|
+
import { formatUnits } from "viem";
|
|
10
|
+
import { BugOutline } from "flowbite-svelte-icons";
|
|
11
|
+
import TableTimeFilters from "../charts/TableTimeFilters.svelte";
|
|
12
|
+
export let id;
|
|
13
|
+
export let subgraphUrl;
|
|
14
|
+
export let rpcUrl = void 0;
|
|
15
|
+
export let handleDebugTradeModal = void 0;
|
|
16
|
+
let startTimestamp;
|
|
17
|
+
let endTimestamp;
|
|
18
|
+
let tradesCount;
|
|
19
|
+
$: orderTradesQuery = createInfiniteQuery({
|
|
20
|
+
queryKey: [id, QKEY_ORDER_TRADES_LIST + id],
|
|
21
|
+
queryFn: async ({ pageParam }) => {
|
|
22
|
+
tradesCount = void 0;
|
|
23
|
+
const [count, trades] = await Promise.all([
|
|
24
|
+
getOrderTradesCount(
|
|
25
|
+
subgraphUrl || "",
|
|
26
|
+
id,
|
|
27
|
+
startTimestamp ? BigInt(startTimestamp) : void 0,
|
|
28
|
+
endTimestamp ? BigInt(endTimestamp) : void 0
|
|
29
|
+
),
|
|
30
|
+
getOrderTradesList(
|
|
31
|
+
subgraphUrl || "",
|
|
32
|
+
id,
|
|
33
|
+
{ page: pageParam + 1, pageSize: DEFAULT_PAGE_SIZE },
|
|
34
|
+
startTimestamp ? BigInt(startTimestamp) : void 0,
|
|
35
|
+
endTimestamp ? BigInt(endTimestamp) : void 0
|
|
36
|
+
)
|
|
37
|
+
]);
|
|
38
|
+
if (typeof count === "number") {
|
|
39
|
+
tradesCount = count;
|
|
40
|
+
}
|
|
41
|
+
return trades;
|
|
42
|
+
},
|
|
43
|
+
initialPageParam: 0,
|
|
44
|
+
getNextPageParam: (lastPage, _allPages, lastPageParam) => {
|
|
45
|
+
return lastPage.length === DEFAULT_PAGE_SIZE ? lastPageParam + 1 : void 0;
|
|
46
|
+
},
|
|
47
|
+
enabled: !!subgraphUrl
|
|
48
|
+
});
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<TanstackAppTable
|
|
52
|
+
query={orderTradesQuery}
|
|
53
|
+
emptyMessage="No trades found"
|
|
54
|
+
rowHoverable={false}
|
|
55
|
+
queryKey={id}
|
|
56
|
+
>
|
|
57
|
+
<svelte:fragment slot="info">
|
|
58
|
+
{#if tradesCount !== undefined}
|
|
59
|
+
<div class="px-2">{tradesCount} Trades</div>
|
|
60
|
+
{/if}
|
|
61
|
+
</svelte:fragment>
|
|
62
|
+
<svelte:fragment slot="timeFilter">
|
|
63
|
+
<TableTimeFilters bind:startTimestamp bind:endTimestamp />
|
|
64
|
+
</svelte:fragment>
|
|
65
|
+
<svelte:fragment slot="head">
|
|
66
|
+
<TableHeadCell padding="p-4">Date</TableHeadCell>
|
|
67
|
+
<TableHeadCell padding="p-0">Sender</TableHeadCell>
|
|
68
|
+
<TableHeadCell padding="p-0">Transaction Hash</TableHeadCell>
|
|
69
|
+
<TableHeadCell padding="p-0">Input</TableHeadCell>
|
|
70
|
+
<TableHeadCell padding="p-0">Output</TableHeadCell>
|
|
71
|
+
<TableHeadCell padding="p-0">IO Ratio</TableHeadCell>
|
|
72
|
+
<TableHeadCell padding="p-0"></TableHeadCell>
|
|
73
|
+
</svelte:fragment>
|
|
74
|
+
|
|
75
|
+
<svelte:fragment slot="bodyRow" let:item>
|
|
76
|
+
<TableBodyCell tdClass="px-4 py-2">
|
|
77
|
+
{formatTimestampSecondsAsLocal(BigInt(item.timestamp))}
|
|
78
|
+
</TableBodyCell>
|
|
79
|
+
<TableBodyCell tdClass="break-all py-2 min-w-32">
|
|
80
|
+
<Hash type={HashType.Wallet} value={item.tradeEvent.transaction.from} />
|
|
81
|
+
</TableBodyCell>
|
|
82
|
+
<TableBodyCell tdClass="break-all py-2 min-w-32">
|
|
83
|
+
<Hash type={HashType.Transaction} value={item.tradeEvent.transaction.id} />
|
|
84
|
+
</TableBodyCell>
|
|
85
|
+
<TableBodyCell tdClass="break-all py-2">
|
|
86
|
+
{formatUnits(
|
|
87
|
+
BigInt(item.inputVaultBalanceChange.amount),
|
|
88
|
+
Number(item.inputVaultBalanceChange.vault.token.decimals ?? 0)
|
|
89
|
+
)}
|
|
90
|
+
{item.inputVaultBalanceChange.vault.token.symbol}
|
|
91
|
+
</TableBodyCell>
|
|
92
|
+
<TableBodyCell tdClass="break-all py-2">
|
|
93
|
+
{formatUnits(
|
|
94
|
+
BigInt(item.outputVaultBalanceChange.amount) * BigInt(-1),
|
|
95
|
+
Number(item.outputVaultBalanceChange.vault.token.decimals ?? 0)
|
|
96
|
+
)}
|
|
97
|
+
{item.outputVaultBalanceChange.vault.token.symbol}
|
|
98
|
+
</TableBodyCell>
|
|
99
|
+
<TableBodyCell tdClass="break-all py-2" data-testid="io-ratio">
|
|
100
|
+
{Math.abs(
|
|
101
|
+
Number(
|
|
102
|
+
formatUnits(
|
|
103
|
+
BigInt(item.inputVaultBalanceChange.amount),
|
|
104
|
+
Number(item.inputVaultBalanceChange.vault.token.decimals ?? 0)
|
|
105
|
+
)
|
|
106
|
+
) /
|
|
107
|
+
Number(
|
|
108
|
+
formatUnits(
|
|
109
|
+
BigInt(item.outputVaultBalanceChange.amount),
|
|
110
|
+
Number(item.outputVaultBalanceChange.vault.token.decimals ?? 0)
|
|
111
|
+
)
|
|
112
|
+
)
|
|
113
|
+
)}
|
|
114
|
+
<span class="text-gray-400">
|
|
115
|
+
({Math.abs(
|
|
116
|
+
Number(
|
|
117
|
+
formatUnits(
|
|
118
|
+
BigInt(item.outputVaultBalanceChange.amount),
|
|
119
|
+
Number(item.outputVaultBalanceChange.vault.token.decimals ?? 0)
|
|
120
|
+
)
|
|
121
|
+
) /
|
|
122
|
+
Number(
|
|
123
|
+
formatUnits(
|
|
124
|
+
BigInt(item.inputVaultBalanceChange.amount),
|
|
125
|
+
Number(item.inputVaultBalanceChange.vault.token.decimals ?? 0)
|
|
126
|
+
)
|
|
127
|
+
)
|
|
128
|
+
)})
|
|
129
|
+
</span>
|
|
130
|
+
</TableBodyCell>
|
|
131
|
+
{#if rpcUrl && handleDebugTradeModal}
|
|
132
|
+
<TableBodyCell tdClass="py-2">
|
|
133
|
+
<button
|
|
134
|
+
data-testid="debug-trade-button"
|
|
135
|
+
class="text-gray-500 hover:text-gray-700"
|
|
136
|
+
on:click={() => {
|
|
137
|
+
if (rpcUrl) handleDebugTradeModal(item.tradeEvent.transaction.id, rpcUrl);
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
140
|
+
<BugOutline size="xs" />
|
|
141
|
+
</button>
|
|
142
|
+
</TableBodyCell>
|
|
143
|
+
{/if}
|
|
144
|
+
</svelte:fragment>
|
|
145
|
+
</TanstackAppTable>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
id: string;
|
|
5
|
+
subgraphUrl: string;
|
|
6
|
+
rpcUrl?: string | undefined;
|
|
7
|
+
handleDebugTradeModal?: ((hash: string, rpcUrl: string) => void) | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
exports?: {} | undefined;
|
|
14
|
+
bindings?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type OrderTradesListTableProps = typeof __propDef.props;
|
|
17
|
+
export type OrderTradesListTableEvents = typeof __propDef.events;
|
|
18
|
+
export type OrderTradesListTableSlots = typeof __propDef.slots;
|
|
19
|
+
export default class OrderTradesListTable extends SvelteComponent<OrderTradesListTableProps, OrderTradesListTableEvents, OrderTradesListTableSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|