@rainlanguage/ui-components 0.0.1-alpha.237 → 0.0.1-alpha.239
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 +18 -20
- 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 +7 -3
- package/dist/__mocks__/MockComponent.svelte.d.ts +1 -0
- 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 +4 -4
- package/dist/__mocks__/stores.js +40 -40
- package/dist/app.css +3 -3
- package/dist/components/ButtonDarkMode.svelte +7 -1
- package/dist/components/ButtonScrub.svelte +22 -0
- package/dist/components/ButtonScrub.svelte.d.ts +25 -0
- package/dist/components/ButtonVaultLink.svelte +3 -2
- package/dist/components/ButtonVaultLink.svelte.d.ts +2 -2
- package/dist/components/CodeMirrorRainlang.svelte +19 -2
- package/dist/components/CodeMirrorRainlang.svelte.d.ts +2 -1
- package/dist/components/Hash.svelte +3 -2
- package/dist/components/{ListViewOrderbookFilters.svelte → ListViewRaindexFilters.svelte} +7 -7
- package/dist/components/{ListViewOrderbookFilters.svelte.d.ts → ListViewRaindexFilters.svelte.d.ts} +7 -7
- package/dist/components/LocalDbStatusBadge.svelte.d.ts +1 -1
- package/dist/components/LocalDbStatusCard.svelte +7 -4
- package/dist/components/LocalDbStatusCard.svelte.d.ts +2 -2
- package/dist/components/LocalDbStatusModal.svelte +16 -14
- package/dist/components/LocalDbStatusModal.svelte.d.ts +2 -2
- package/dist/components/OrderOrVaultHash.svelte +2 -2
- package/dist/components/OrderOrVaultHash.svelte.d.ts +2 -2
- package/dist/components/Sensitive.svelte +16 -0
- package/dist/components/Sensitive.svelte.d.ts +28 -0
- package/dist/components/TanstackAppTable.svelte +146 -87
- package/dist/components/TanstackAppTable.svelte.d.ts +1 -1
- package/dist/components/VaultBalanceChangeTypeFilter.svelte +1 -1
- package/dist/components/VaultBalanceChangeTypeFilter.svelte.d.ts +1 -1
- package/dist/components/VaultCard.svelte +1 -1
- package/dist/components/VaultCard.svelte.d.ts +1 -1
- package/dist/components/charts/OrderTradesChart.svelte +116 -97
- package/dist/components/charts/OrderTradesChart.svelte.d.ts +2 -2
- package/dist/components/charts/transformAndSortData.d.ts +1 -1
- package/dist/components/charts/transformAndSortData.js +19 -19
- package/dist/components/deployment/DeploymentSteps.svelte +5 -2
- package/dist/components/deployment/DeploymentSteps.svelte.d.ts +1 -1
- package/dist/components/deployment/DeploymentsSection.svelte.d.ts +1 -1
- package/dist/components/deployment/DepositInput.svelte +1 -1
- package/dist/components/deployment/DepositInput.svelte.d.ts +1 -1
- package/dist/components/deployment/FieldDefinitionInput.svelte +1 -1
- package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +1 -1
- package/dist/components/deployment/OrderPage.svelte.d.ts +1 -1
- package/dist/components/deployment/SelectToken.svelte.d.ts +1 -1
- package/dist/components/deployment/TokenIOInput.svelte +1 -1
- package/dist/components/deployment/TokenIOInput.svelte.d.ts +1 -1
- package/dist/components/deployment/TokenSelectionModal.svelte.d.ts +1 -1
- package/dist/components/detail/OrderDetail.svelte +12 -6
- package/dist/components/detail/OrderDetail.svelte.d.ts +2 -2
- package/dist/components/detail/TanstackOrderQuote.svelte +22 -0
- package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +1 -1
- package/dist/components/detail/VaultDetail.svelte +12 -10
- package/dist/components/detail/VaultDetail.svelte.d.ts +2 -2
- package/dist/components/dropdown/{DropdownOrderbooksFilter.svelte → DropdownRaindexesFilter.svelte} +54 -54
- package/dist/components/dropdown/DropdownRaindexesFilter.svelte.d.ts +25 -0
- package/dist/components/dropdown/DropdownTokensFilter.svelte.d.ts +1 -1
- package/dist/components/icon/Refresh.svelte +2 -1
- package/dist/components/icon/Refresh.svelte.d.ts +1 -0
- package/dist/components/input/InputTokenAmount.svelte +16 -1
- package/dist/components/input/InputTokenAmount.svelte.d.ts +1 -1
- package/dist/components/tables/OrderTradesListTable.svelte +113 -98
- package/dist/components/tables/OrderTradesListTable.svelte.d.ts +1 -1
- package/dist/components/tables/OrderVaultsVolTable.svelte +1 -1
- package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +1 -1
- package/dist/components/tables/OrdersListTable.svelte +19 -17
- package/dist/components/tables/OrdersListTable.svelte.d.ts +1 -1
- package/dist/components/tables/VaultBalanceChangesTable.svelte +1 -1
- package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +1 -1
- package/dist/components/tables/VaultsListTable.svelte +24 -21
- package/dist/components/tables/VaultsListTable.svelte.d.ts +2 -2
- package/dist/components/transactions/FixedBottomTransaction.svelte +1 -0
- package/dist/components/transactions/getStatusEmoji.d.ts +1 -1
- package/dist/components/transactions/getStatusEmoji.js +13 -13
- package/dist/consts.js +1 -1
- package/dist/errors/DeploymentStepsError.js +3 -3
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/hooks/useLocalDb.d.ts +1 -1
- package/dist/hooks/useLocalDb.js +3 -3
- package/dist/hooks/useRaindexClient.d.ts +1 -1
- package/dist/hooks/useRaindexClient.js +4 -4
- package/dist/hooks/useRaindexOrderBuilder.d.ts +1 -1
- package/dist/hooks/useRaindexOrderBuilder.js +4 -4
- package/dist/index.d.ts +122 -114
- package/dist/index.js +115 -109
- package/dist/models/Transaction.d.ts +4 -4
- package/dist/models/Transaction.js +9 -9
- package/dist/providers/RaindexClientProvider.svelte +1 -1
- package/dist/providers/RaindexClientProvider.svelte.d.ts +1 -1
- package/dist/providers/RaindexOrderBuilderProvider.svelte +1 -1
- package/dist/providers/RaindexOrderBuilderProvider.svelte.d.ts +1 -1
- package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte.d.ts +1 -1
- package/dist/providers/dotrainRegistry/context.d.ts +2 -2
- package/dist/providers/dotrainRegistry/context.js +13 -10
- package/dist/providers/dotrainRegistry/useDotrainRegistry.d.ts +1 -1
- package/dist/providers/dotrainRegistry/useDotrainRegistry.js +8 -8
- package/dist/providers/registry/RegistryManager.js +8 -7
- package/dist/providers/registry/context.d.ts +1 -1
- package/dist/providers/registry/context.js +9 -9
- package/dist/providers/registry/useRegistry.d.ts +1 -1
- package/dist/providers/registry/useRegistry.js +5 -5
- package/dist/providers/toasts/context.d.ts +2 -2
- package/dist/providers/toasts/context.js +4 -4
- package/dist/providers/toasts/useToasts.d.ts +1 -1
- package/dist/providers/toasts/useToasts.js +4 -4
- package/dist/providers/transactions/TransactionManager.d.ts +14 -15
- package/dist/providers/transactions/TransactionManager.js +107 -107
- package/dist/providers/transactions/context.d.ts +1 -1
- package/dist/providers/transactions/context.js +4 -4
- package/dist/providers/transactions/useTransactions.js +2 -2
- package/dist/providers/wallet/context.d.ts +1 -1
- package/dist/providers/wallet/context.js +11 -11
- package/dist/providers/wallet/useAccount.js +27 -27
- package/dist/queries/keys.js +10 -10
- package/dist/queries/queryClient.d.ts +1 -1
- package/dist/queries/queryClient.js +8 -8
- package/dist/services/awaitTransactionIndexing.d.ts +8 -8
- package/dist/services/awaitTransactionIndexing.js +10 -8
- package/dist/services/getExplorerLink.js +2 -2
- package/dist/services/handleShareChoices.d.ts +1 -1
- package/dist/services/handleShareChoices.js +4 -4
- package/dist/services/historicalOrderCharts.d.ts +2 -2
- package/dist/services/historicalOrderCharts.js +260 -201
- package/dist/services/index.d.ts +5 -3
- package/dist/services/index.js +3 -2
- package/dist/services/loadRegistryUrl.d.ts +1 -1
- package/dist/services/loadRegistryUrl.js +5 -5
- package/dist/services/pairTradesChartData.d.ts +2 -2
- package/dist/services/pairTradesChartData.js +28 -24
- package/dist/services/registry.d.ts +1 -1
- package/dist/services/registry.js +10 -10
- package/dist/services/time.d.ts +1 -1
- package/dist/services/time.js +35 -35
- package/dist/services/validateAmount.d.ts +30 -0
- package/dist/services/validateAmount.js +53 -0
- package/dist/storesGeneric/cachedWritableStore.d.ts +2 -2
- package/dist/storesGeneric/cachedWritableStore.js +3 -3
- 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 +2 -2
- package/dist/types/appStores.d.ts +3 -3
- package/dist/types/modal.d.ts +3 -3
- package/dist/types/order.d.ts +1 -1
- package/dist/types/toast.d.ts +2 -2
- package/dist/types/tokenBalance.d.ts +1 -1
- package/dist/types/transaction.d.ts +4 -4
- package/dist/utils/breadcrumbs.js +2 -2
- package/dist/utils/codeMirrorThemes.js +80 -74
- package/dist/utils/configHelpers.d.ts +1 -1
- package/dist/utils/configHelpers.js +6 -6
- package/dist/utils/constructHashLink.d.ts +3 -3
- package/dist/utils/constructHashLink.js +39 -37
- package/dist/utils/getNetworkName.js +5 -5
- 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.js +5 -3
- package/dist/utils/stripTrailingWhitespace.d.ts +16 -0
- package/dist/utils/stripTrailingWhitespace.js +22 -0
- package/dist/utils/tokens.d.ts +1 -1
- package/dist/utils/tokens.js +1 -1
- package/dist/utils/vaultBalanceChangeLabels.d.ts +1 -1
- package/dist/utils/vaultBalanceChangeLabels.js +11 -11
- package/package.json +89 -89
- package/dist/components/dropdown/DropdownOrderbooksFilter.svelte.d.ts +0 -25
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# create-svelte
|
|
2
2
|
|
|
3
|
-
Everything you need to build a Svelte library, powered by
|
|
3
|
+
Everything you need to build a Svelte library, powered by
|
|
4
|
+
[`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
|
|
4
5
|
|
|
5
|
-
Read more about creating a library
|
|
6
|
+
Read more about creating a library
|
|
7
|
+
[in the docs](https://svelte.dev/docs/kit/packaging).
|
|
6
8
|
|
|
7
9
|
## Creating a project
|
|
8
10
|
|
|
@@ -18,7 +20,8 @@ npx sv create my-app
|
|
|
18
20
|
|
|
19
21
|
## Developing
|
|
20
22
|
|
|
21
|
-
Once you've created a project and installed dependencies with `npm install` (or
|
|
23
|
+
Once you've created a project and installed dependencies with `npm install` (or
|
|
24
|
+
`pnpm install` or `yarn`), start a development server:
|
|
22
25
|
|
|
23
26
|
```bash
|
|
24
27
|
npm run dev
|
|
@@ -27,7 +30,8 @@ npm run dev
|
|
|
27
30
|
npm run dev -- --open
|
|
28
31
|
```
|
|
29
32
|
|
|
30
|
-
Everything inside `src/lib` is part of your library, everything inside
|
|
33
|
+
Everything inside `src/lib` is part of your library, everything inside
|
|
34
|
+
`src/routes` can be used as a showcase or preview app.
|
|
31
35
|
|
|
32
36
|
## Building
|
|
33
37
|
|
|
@@ -45,11 +49,15 @@ npm run build
|
|
|
45
49
|
|
|
46
50
|
You can preview the production build with `npm run preview`.
|
|
47
51
|
|
|
48
|
-
> To deploy your app, you may need to install an
|
|
52
|
+
> To deploy your app, you may need to install an
|
|
53
|
+
> [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
|
49
54
|
|
|
50
55
|
## Publishing
|
|
51
56
|
|
|
52
|
-
Go into the `package.json` and give your package the desired name through the
|
|
57
|
+
Go into the `package.json` and give your package the desired name through the
|
|
58
|
+
`"name"` option. Also consider adding a `"license"` field and point it to a
|
|
59
|
+
`LICENSE` file which you can create from a template (one popular option is the
|
|
60
|
+
[MIT license](https://opensource.org/license/mit/)).
|
|
53
61
|
|
|
54
62
|
To publish your library to [npm](https://www.npmjs.com):
|
|
55
63
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
version:
|
|
1
|
+
version: 6
|
|
2
2
|
networks:
|
|
3
3
|
flare:
|
|
4
4
|
rpc: https://rpc.ankr.com/flare
|
|
@@ -37,26 +37,24 @@ networks:
|
|
|
37
37
|
chain-id: 1
|
|
38
38
|
currency: ETH
|
|
39
39
|
subgraphs:
|
|
40
|
-
flare: https://
|
|
41
|
-
base: https://
|
|
42
|
-
sepolia: https://
|
|
43
|
-
polygon: https://
|
|
44
|
-
arbitrum: https://
|
|
45
|
-
matchain: https://
|
|
46
|
-
bsc: https://
|
|
47
|
-
linea: https://
|
|
48
|
-
ethereum: https://
|
|
40
|
+
flare: https://example.com/subgraphs/flare/gn
|
|
41
|
+
base: https://example.com/subgraphs/base/gn
|
|
42
|
+
sepolia: https://example.com/subgraphs/sepolia/gn
|
|
43
|
+
polygon: https://example.com/subgraphs/polygon/gn
|
|
44
|
+
arbitrum: https://example.com/subgraphs/arbitrum/gn
|
|
45
|
+
matchain: https://example.com/subgraphs/matchain/gn
|
|
46
|
+
bsc: https://example.com/subgraphs/bsc/gn
|
|
47
|
+
linea: https://example.com/subgraphs/linea/gn
|
|
48
|
+
ethereum: https://example.com/subgraphs/ethereum/gn
|
|
49
49
|
metaboards:
|
|
50
|
-
flare: https://
|
|
51
|
-
base: https://
|
|
52
|
-
sepolia: https://
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
ethereum: https://api.goldsky.com/api/public/project_clv14x04y9kzi01saerx7bxpg/subgraphs/metadata-mainnet/2024-10-25-2857/gn
|
|
59
|
-
orderbooks:
|
|
50
|
+
flare: https://example.com/metaboards/flare/gn
|
|
51
|
+
base: https://example.com/metaboards/base/gn
|
|
52
|
+
sepolia: https://example.com/metaboards/sepolia/gn
|
|
53
|
+
arbitrum: https://example.com/metaboards/arbitrum/gn
|
|
54
|
+
bsc: https://example.com/metaboards/bsc/gn
|
|
55
|
+
linea: https://example.com/metaboards/linea/gn
|
|
56
|
+
ethereum: https://example.com/metaboards/ethereum/gn
|
|
57
|
+
raindexes:
|
|
60
58
|
flare:
|
|
61
59
|
address: 0xCEe8Cd002F151A536394E564b84076c41bBBcD4d
|
|
62
60
|
network: flare
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from "svelte";
|
|
2
|
+
export let value = void 0;
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<!-- Test double for `svelte-codemirror-editor`: renders all props as attributes
|
|
7
|
+
(like the shared MockComponent) and additionally forwards a native blur on the
|
|
8
|
+
element as the component-level `blur` event that CodeMirrorRainlang listens for. -->
|
|
9
|
+
<div
|
|
10
|
+
data-testid="mock-component"
|
|
11
|
+
{...$$props}
|
|
12
|
+
tabindex="0"
|
|
13
|
+
role="textbox"
|
|
14
|
+
on:blur={() => dispatch('blur')}
|
|
15
|
+
>
|
|
16
|
+
{value}
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
value?: string | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
blur: CustomEvent<any>;
|
|
9
|
+
} & {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
exports?: undefined;
|
|
14
|
+
bindings?: undefined;
|
|
15
|
+
};
|
|
16
|
+
export type MockCodeMirrorEditorProps = typeof __propDef.props;
|
|
17
|
+
export type MockCodeMirrorEditorEvents = typeof __propDef.events;
|
|
18
|
+
export type MockCodeMirrorEditorSlots = typeof __propDef.slots;
|
|
19
|
+
export default class MockCodeMirrorEditor extends SvelteComponent<MockCodeMirrorEditorProps, MockCodeMirrorEditorEvents, MockCodeMirrorEditorSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { writable } from
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
2
|
export const props = writable();
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
|
|
1
|
+
<script>import { afterUpdate } from "svelte";
|
|
2
|
+
import { props } from "./MockComponent";
|
|
3
|
+
export let testid = "mock-component";
|
|
4
|
+
afterUpdate(() => {
|
|
5
|
+
props.set($$restProps);
|
|
6
|
+
});
|
|
3
7
|
</script>
|
|
4
8
|
|
|
5
|
-
<div data-testid=
|
|
9
|
+
<div data-testid={testid} {...$$restProps}>
|
|
6
10
|
<slot />
|
|
7
11
|
</div>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type Config } from
|
|
1
|
+
import { type Config } from "@wagmi/core";
|
|
2
2
|
export declare const mockWeb3Config: Config;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { createConfig, http, fallback } from
|
|
2
|
-
import { mock } from
|
|
3
|
-
import { polygonAmoy } from
|
|
1
|
+
import { createConfig, http, fallback } from "@wagmi/core";
|
|
2
|
+
import { mock } from "@wagmi/connectors";
|
|
3
|
+
import { polygonAmoy } from "@wagmi/core/chains";
|
|
4
4
|
export const mockWeb3Config = createConfig({
|
|
5
5
|
multiInjectedProviderDiscovery: true,
|
|
6
6
|
chains: [polygonAmoy],
|
|
7
7
|
connectors: [
|
|
8
8
|
mock({
|
|
9
|
-
accounts: [
|
|
10
|
-
})
|
|
9
|
+
accounts: ["0xf08bcbce72f62c95dcb7c07dcb5ed26acfcfbc11"],
|
|
10
|
+
}),
|
|
11
11
|
],
|
|
12
12
|
transports: {
|
|
13
|
-
[polygonAmoy.id]: fallback([
|
|
14
|
-
|
|
13
|
+
[polygonAmoy.id]: fallback([
|
|
14
|
+
http(),
|
|
15
|
+
http("https://rpc-amoy.polygon.technology"),
|
|
16
|
+
]),
|
|
17
|
+
},
|
|
15
18
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QueryClient, createInfiniteQuery, createQuery } from
|
|
1
|
+
import { QueryClient, createInfiniteQuery, createQuery, } from "@tanstack/svelte-query";
|
|
2
2
|
// A helper function to create a resolvable mock query.
|
|
3
3
|
// This gives us more control over when each query resolves.
|
|
4
4
|
export const createResolvableMockQuery = (queryFn) => {
|
|
@@ -35,13 +35,13 @@ export const createResolvableInfiniteQuery = (_queryFn, getNextPageParam = (_las
|
|
|
35
35
|
return queryFn(pageParam);
|
|
36
36
|
},
|
|
37
37
|
initialPageParam: 0,
|
|
38
|
-
getNextPageParam
|
|
38
|
+
getNextPageParam,
|
|
39
39
|
}, new QueryClient({
|
|
40
40
|
defaultOptions: {
|
|
41
41
|
queries: {
|
|
42
|
-
staleTime: Infinity
|
|
43
|
-
}
|
|
44
|
-
}
|
|
42
|
+
staleTime: Infinity,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
45
|
}));
|
|
46
46
|
return { query, resolve, refetch };
|
|
47
47
|
};
|
|
@@ -52,13 +52,13 @@ export const createResolvableQuery = (_queryFn) => {
|
|
|
52
52
|
queryKey: [],
|
|
53
53
|
queryFn: () => {
|
|
54
54
|
return queryFn();
|
|
55
|
-
}
|
|
55
|
+
},
|
|
56
56
|
}, new QueryClient({
|
|
57
57
|
defaultOptions: {
|
|
58
58
|
queries: {
|
|
59
|
-
staleTime: Infinity
|
|
60
|
-
}
|
|
61
|
-
}
|
|
59
|
+
staleTime: Infinity,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
62
|
}));
|
|
63
63
|
return { query, resolve };
|
|
64
64
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Address } from
|
|
2
|
-
import { type Config } from
|
|
1
|
+
import type { Address } from "@rainlanguage/raindex";
|
|
2
|
+
import { type Config } from "@wagmi/core";
|
|
3
3
|
type MockDeployment = {
|
|
4
4
|
key: string;
|
|
5
5
|
name?: string;
|
|
@@ -43,7 +43,7 @@ export declare const mockActiveNetworkRefStore: {
|
|
|
43
43
|
set: (this: void, value: string) => void;
|
|
44
44
|
mockSetSubscribeValue: (value: string) => void;
|
|
45
45
|
};
|
|
46
|
-
export declare const
|
|
46
|
+
export declare const mockActiveRaindexRefStore: {
|
|
47
47
|
subscribe: (this: void, run: import("svelte/store").Subscriber<string>, invalidate?: import("svelte/store").Invalidator<string> | undefined) => import("svelte/store").Unsubscriber;
|
|
48
48
|
set: (this: void, value: string) => void;
|
|
49
49
|
mockSetSubscribeValue: (value: string) => void;
|
|
@@ -91,7 +91,7 @@ export declare const mockActiveTokensStore: {
|
|
|
91
91
|
set: (this: void, value: string[]) => void;
|
|
92
92
|
mockSetSubscribeValue: (value: string[]) => void;
|
|
93
93
|
};
|
|
94
|
-
export declare const
|
|
94
|
+
export declare const mockActiveRaindexAddressesStore: {
|
|
95
95
|
subscribe: (this: void, run: import("svelte/store").Subscriber<string[]>, invalidate?: import("svelte/store").Invalidator<string[]> | undefined) => import("svelte/store").Unsubscriber;
|
|
96
96
|
set: (this: void, value: string[]) => void;
|
|
97
97
|
mockSetSubscribeValue: (value: string[]) => void;
|
package/dist/__mocks__/stores.js
CHANGED
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
import { writable } from
|
|
2
|
-
import {} from
|
|
3
|
-
import { mockWeb3Config } from
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
|
+
import {} from "@wagmi/core";
|
|
3
|
+
import { mockWeb3Config } from "./mockWeb3Config";
|
|
4
4
|
if (import.meta.vitest) {
|
|
5
|
-
vi.mock(import(
|
|
5
|
+
vi.mock(import("@rainlanguage/raindex"), async (importOriginal) => {
|
|
6
6
|
const actual = await importOriginal();
|
|
7
7
|
return {
|
|
8
|
-
...actual
|
|
8
|
+
...actual,
|
|
9
9
|
};
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
const initialPageState = {
|
|
13
13
|
data: {
|
|
14
|
-
dotrain:
|
|
15
|
-
deployment: { key:
|
|
16
|
-
orderDetail: {}
|
|
14
|
+
dotrain: "some dotrain content",
|
|
15
|
+
deployment: { key: "deploy-key", name: "", description: "" },
|
|
16
|
+
orderDetail: {},
|
|
17
17
|
},
|
|
18
|
-
url: new URL(
|
|
18
|
+
url: new URL("http://localhost:3000/deploy"),
|
|
19
19
|
params: {},
|
|
20
20
|
form: {},
|
|
21
21
|
status: 200,
|
|
22
22
|
error: null,
|
|
23
23
|
route: {
|
|
24
|
-
id: null
|
|
25
|
-
}
|
|
24
|
+
id: null,
|
|
25
|
+
},
|
|
26
26
|
};
|
|
27
27
|
const mockPageWritable = writable(initialPageState);
|
|
28
28
|
const mockShowInactiveOrdersWritable = writable(true);
|
|
29
|
-
const mockOrderHashWritable = writable(
|
|
29
|
+
const mockOrderHashWritable = writable("");
|
|
30
30
|
const mockHideZeroBalanceVaultsWritable = writable(false);
|
|
31
31
|
const mockHideInactiveOrdersVaultsWritable = writable(false);
|
|
32
|
-
const mockActiveNetworkRefWritable = writable(
|
|
33
|
-
const
|
|
32
|
+
const mockActiveNetworkRefWritable = writable("");
|
|
33
|
+
const mockActiveRaindexRefWritable = writable("");
|
|
34
34
|
const mockActiveAccountsWritable = writable({});
|
|
35
|
-
const mockSubgraphUrlWritable = writable(
|
|
35
|
+
const mockSubgraphUrlWritable = writable("");
|
|
36
36
|
const mockChainIdWritable = writable(0);
|
|
37
37
|
const mockConnectedWritable = writable(true);
|
|
38
38
|
const mockWagmiConfigWritable = writable(mockWeb3Config);
|
|
39
39
|
const mockSelectedChainIdsWritable = writable([]);
|
|
40
40
|
const mockActiveTokensWritable = writable([]);
|
|
41
|
-
const
|
|
42
|
-
const mockOwnerFilterWritable = writable(
|
|
41
|
+
const mockActiveRaindexAddressesWritable = writable([]);
|
|
42
|
+
const mockOwnerFilterWritable = writable("");
|
|
43
43
|
export const mockShowInactiveOrdersStore = {
|
|
44
44
|
subscribe: mockShowInactiveOrdersWritable.subscribe,
|
|
45
45
|
set: mockShowInactiveOrdersWritable.set,
|
|
46
|
-
mockSetSubscribeValue: (value) => mockShowInactiveOrdersWritable.set(value)
|
|
46
|
+
mockSetSubscribeValue: (value) => mockShowInactiveOrdersWritable.set(value),
|
|
47
47
|
};
|
|
48
48
|
export const mockOrderHashStore = {
|
|
49
49
|
subscribe: mockOrderHashWritable.subscribe,
|
|
50
50
|
set: mockOrderHashWritable.set,
|
|
51
|
-
mockSetSubscribeValue: (value) => mockOrderHashWritable.set(value)
|
|
51
|
+
mockSetSubscribeValue: (value) => mockOrderHashWritable.set(value),
|
|
52
52
|
};
|
|
53
53
|
export const mockHideZeroBalanceVaultsStore = {
|
|
54
54
|
subscribe: mockHideZeroBalanceVaultsWritable.subscribe,
|
|
55
55
|
set: mockHideZeroBalanceVaultsWritable.set,
|
|
56
|
-
mockSetSubscribeValue: (value) => mockHideZeroBalanceVaultsWritable.set(value)
|
|
56
|
+
mockSetSubscribeValue: (value) => mockHideZeroBalanceVaultsWritable.set(value),
|
|
57
57
|
};
|
|
58
58
|
export const mockHideInactiveOrdersVaultsStore = {
|
|
59
59
|
subscribe: mockHideInactiveOrdersVaultsWritable.subscribe,
|
|
60
60
|
set: mockHideInactiveOrdersVaultsWritable.set,
|
|
61
|
-
mockSetSubscribeValue: (value) => mockHideInactiveOrdersVaultsWritable.set(value)
|
|
61
|
+
mockSetSubscribeValue: (value) => mockHideInactiveOrdersVaultsWritable.set(value),
|
|
62
62
|
};
|
|
63
63
|
export const mockActiveNetworkRefStore = {
|
|
64
64
|
subscribe: mockActiveNetworkRefWritable.subscribe,
|
|
65
65
|
set: mockActiveNetworkRefWritable.set,
|
|
66
|
-
mockSetSubscribeValue: (value) => mockActiveNetworkRefWritable.set(value)
|
|
66
|
+
mockSetSubscribeValue: (value) => mockActiveNetworkRefWritable.set(value),
|
|
67
67
|
};
|
|
68
|
-
export const
|
|
69
|
-
subscribe:
|
|
70
|
-
set:
|
|
71
|
-
mockSetSubscribeValue: (value) =>
|
|
68
|
+
export const mockActiveRaindexRefStore = {
|
|
69
|
+
subscribe: mockActiveRaindexRefWritable.subscribe,
|
|
70
|
+
set: mockActiveRaindexRefWritable.set,
|
|
71
|
+
mockSetSubscribeValue: (value) => mockActiveRaindexRefWritable.set(value),
|
|
72
72
|
};
|
|
73
73
|
export const mockActiveAccountsStore = {
|
|
74
74
|
subscribe: mockActiveAccountsWritable.subscribe,
|
|
75
75
|
set: mockActiveAccountsWritable.set,
|
|
76
|
-
mockSetSubscribeValue: (value) => mockActiveAccountsWritable.set(value)
|
|
76
|
+
mockSetSubscribeValue: (value) => mockActiveAccountsWritable.set(value),
|
|
77
77
|
};
|
|
78
78
|
export const mockSubgraphUrlStore = {
|
|
79
79
|
subscribe: mockSubgraphUrlWritable.subscribe,
|
|
80
80
|
set: mockSubgraphUrlWritable.set,
|
|
81
|
-
mockSetSubscribeValue: (value) => mockSubgraphUrlWritable.set(value)
|
|
81
|
+
mockSetSubscribeValue: (value) => mockSubgraphUrlWritable.set(value),
|
|
82
82
|
};
|
|
83
83
|
export const mockChainIdStore = {
|
|
84
84
|
subscribe: mockChainIdWritable.subscribe,
|
|
85
85
|
set: mockChainIdWritable.set,
|
|
86
|
-
mockSetSubscribeValue: (value) => mockChainIdWritable.set(value)
|
|
86
|
+
mockSetSubscribeValue: (value) => mockChainIdWritable.set(value),
|
|
87
87
|
};
|
|
88
88
|
export const mockConnectedStore = {
|
|
89
89
|
subscribe: mockConnectedWritable.subscribe,
|
|
90
90
|
set: mockConnectedWritable.set,
|
|
91
91
|
update: mockConnectedWritable.update,
|
|
92
|
-
mockSetSubscribeValue: (value) => mockConnectedWritable.set(value)
|
|
92
|
+
mockSetSubscribeValue: (value) => mockConnectedWritable.set(value),
|
|
93
93
|
};
|
|
94
94
|
export const mockWagmiConfigStore = {
|
|
95
95
|
subscribe: mockWagmiConfigWritable.subscribe,
|
|
96
96
|
set: mockWagmiConfigWritable.set,
|
|
97
97
|
update: mockWagmiConfigWritable.update,
|
|
98
|
-
mockSetSubscribeValue: (value) => mockWagmiConfigWritable.set(value)
|
|
98
|
+
mockSetSubscribeValue: (value) => mockWagmiConfigWritable.set(value),
|
|
99
99
|
};
|
|
100
100
|
export const mockSelectedChainIdsStore = {
|
|
101
101
|
subscribe: mockSelectedChainIdsWritable.subscribe,
|
|
102
102
|
set: mockSelectedChainIdsWritable.set,
|
|
103
|
-
mockSetSubscribeValue: (value) => mockSelectedChainIdsWritable.set(value)
|
|
103
|
+
mockSetSubscribeValue: (value) => mockSelectedChainIdsWritable.set(value),
|
|
104
104
|
};
|
|
105
105
|
export const mockPageStore = {
|
|
106
106
|
subscribe: mockPageWritable.subscribe,
|
|
@@ -108,23 +108,23 @@ export const mockPageStore = {
|
|
|
108
108
|
mockSetSubscribeValue: (newValue) => {
|
|
109
109
|
mockPageWritable.update((currentValue) => ({
|
|
110
110
|
...currentValue,
|
|
111
|
-
...newValue
|
|
111
|
+
...newValue,
|
|
112
112
|
}));
|
|
113
113
|
},
|
|
114
|
-
reset: () => mockPageWritable.set(initialPageState)
|
|
114
|
+
reset: () => mockPageWritable.set(initialPageState),
|
|
115
115
|
};
|
|
116
116
|
export const mockActiveTokensStore = {
|
|
117
117
|
subscribe: mockActiveTokensWritable.subscribe,
|
|
118
118
|
set: mockActiveTokensWritable.set,
|
|
119
|
-
mockSetSubscribeValue: (value) => mockActiveTokensWritable.set(value)
|
|
119
|
+
mockSetSubscribeValue: (value) => mockActiveTokensWritable.set(value),
|
|
120
120
|
};
|
|
121
|
-
export const
|
|
122
|
-
subscribe:
|
|
123
|
-
set:
|
|
124
|
-
mockSetSubscribeValue: (value) =>
|
|
121
|
+
export const mockActiveRaindexAddressesStore = {
|
|
122
|
+
subscribe: mockActiveRaindexAddressesWritable.subscribe,
|
|
123
|
+
set: mockActiveRaindexAddressesWritable.set,
|
|
124
|
+
mockSetSubscribeValue: (value) => mockActiveRaindexAddressesWritable.set(value),
|
|
125
125
|
};
|
|
126
126
|
export const mockOwnerFilterStore = {
|
|
127
127
|
subscribe: mockOwnerFilterWritable.subscribe,
|
|
128
128
|
set: mockOwnerFilterWritable.set,
|
|
129
|
-
mockSetSubscribeValue: (value) => mockOwnerFilterWritable.set(value)
|
|
129
|
+
mockSetSubscribeValue: (value) => mockOwnerFilterWritable.set(value),
|
|
130
130
|
};
|
package/dist/app.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
1
|
+
@import "tailwindcss/base";
|
|
2
|
+
@import "tailwindcss/components";
|
|
3
|
+
@import "tailwindcss/utilities";
|
|
@@ -9,6 +9,12 @@ function toggle(e) {
|
|
|
9
9
|
}
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
|
-
<button
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
title="Toggle dark mode"
|
|
15
|
+
aria-label="Toggle dark mode"
|
|
16
|
+
data-testid="dark-mode-toggle"
|
|
17
|
+
on:click={toggle}
|
|
18
|
+
>
|
|
13
19
|
<DarkMode />
|
|
14
20
|
</button>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>import { EyeOutline, EyeSlashOutline } from "flowbite-svelte-icons";
|
|
2
|
+
import { scrub as scrubStore } from "../storesGeneric/scrub";
|
|
3
|
+
export let scrub = scrubStore;
|
|
4
|
+
function toggle() {
|
|
5
|
+
scrub.update((value) => !value);
|
|
6
|
+
}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<button
|
|
10
|
+
type="button"
|
|
11
|
+
on:click={toggle}
|
|
12
|
+
data-testid="scrub-toggle"
|
|
13
|
+
aria-pressed={$scrub}
|
|
14
|
+
title={$scrub ? 'Show addresses and hashes' : 'Hide addresses and hashes for screenshots'}
|
|
15
|
+
class="rounded-lg p-2 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white"
|
|
16
|
+
>
|
|
17
|
+
{#if $scrub}
|
|
18
|
+
<EyeSlashOutline />
|
|
19
|
+
{:else}
|
|
20
|
+
<EyeOutline />
|
|
21
|
+
{/if}
|
|
22
|
+
</button>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Writable } from 'svelte/store';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
/**
|
|
6
|
+
* Eyeball toggle for the global "scrub" mode. Sits next to the dark-mode
|
|
7
|
+
* button in the sidebar. Clicking it masks/unmasks every address and
|
|
8
|
+
* transaction hash in the GUI for safe screenshotting.
|
|
9
|
+
*
|
|
10
|
+
* The store is injectable for testing; it defaults to the global scrub store.
|
|
11
|
+
*/ scrub?: Writable<boolean>;
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {};
|
|
17
|
+
exports?: {} | undefined;
|
|
18
|
+
bindings?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
export type ButtonScrubProps = typeof __propDef.props;
|
|
21
|
+
export type ButtonScrubEvents = typeof __propDef.events;
|
|
22
|
+
export type ButtonScrubSlots = typeof __propDef.slots;
|
|
23
|
+
export default class ButtonScrub extends SvelteComponent<ButtonScrubProps, ButtonScrubEvents, ButtonScrubSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import Tooltip from "./Tooltip.svelte";
|
|
3
3
|
export let tokenVault;
|
|
4
4
|
export let chainId;
|
|
5
|
-
export let
|
|
5
|
+
export let raindexAddress;
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<div
|
|
@@ -14,8 +14,9 @@ export let orderbookAddress;
|
|
|
14
14
|
ID: <span class="font-mono">{toHex(tokenVault.vaultId)}</span>
|
|
15
15
|
</Tooltip>
|
|
16
16
|
<a
|
|
17
|
-
href={`/vaults/${chainId}-${
|
|
17
|
+
href={`/vaults/${chainId}-${raindexAddress}-${tokenVault.id}`}
|
|
18
18
|
id={`token-info-${tokenVault.vaultId}`}
|
|
19
|
+
class="text-blue-500 hover:underline"
|
|
19
20
|
>
|
|
20
21
|
{tokenVault.token.name} ({tokenVault.token.symbol})
|
|
21
22
|
</a>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Address, RaindexVault } from '@rainlanguage/
|
|
2
|
+
import type { Address, RaindexVault } from '@rainlanguage/raindex';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
tokenVault: RaindexVault;
|
|
6
6
|
chainId: number;
|
|
7
|
-
|
|
7
|
+
raindexAddress: Address;
|
|
8
8
|
};
|
|
9
9
|
events: {
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
<script>import CodeMirror from "svelte-codemirror-editor";
|
|
2
2
|
import { RainlangLR } from "codemirror-rainlang";
|
|
3
|
+
import { stripTrailingWhitespace } from "../utils/stripTrailingWhitespace";
|
|
3
4
|
export let order = void 0;
|
|
4
5
|
export let rainlangText = void 0;
|
|
5
6
|
export let codeMirrorTheme;
|
|
6
7
|
export let codeMirrorDisabled = true;
|
|
7
8
|
export let codeMirrorStyles = {};
|
|
9
|
+
export let onSave = void 0;
|
|
10
|
+
let value;
|
|
11
|
+
$: value = rainlangText ?? order?.rainlang;
|
|
12
|
+
function handleBlur() {
|
|
13
|
+
if (value === void 0) return;
|
|
14
|
+
const stripped = stripTrailingWhitespace(value);
|
|
15
|
+
value = stripped;
|
|
16
|
+
rainlangText = stripped;
|
|
17
|
+
onSave?.(stripped);
|
|
18
|
+
}
|
|
8
19
|
</script>
|
|
9
20
|
|
|
10
|
-
|
|
21
|
+
<!-- Render the editor whenever a source value is present, including an empty
|
|
22
|
+
string left by stripping whitespace-only input on blur. -->
|
|
23
|
+
{#if value != null}
|
|
11
24
|
<CodeMirror
|
|
12
|
-
value
|
|
25
|
+
{value}
|
|
13
26
|
extensions={[RainlangLR]}
|
|
14
27
|
theme={codeMirrorTheme}
|
|
15
28
|
readonly={codeMirrorDisabled}
|
|
@@ -21,5 +34,9 @@ export let codeMirrorStyles = {};
|
|
|
21
34
|
},
|
|
22
35
|
...codeMirrorStyles
|
|
23
36
|
}}
|
|
37
|
+
on:change={(e) => {
|
|
38
|
+
value = e.detail;
|
|
39
|
+
}}
|
|
40
|
+
on:blur={handleBlur}
|
|
24
41
|
/>
|
|
25
42
|
{/if}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { RaindexOrder } from '@rainlanguage/
|
|
2
|
+
import type { RaindexOrder } from '@rainlanguage/raindex';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
order?: RaindexOrder | undefined;
|
|
@@ -7,6 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
codeMirrorTheme: any;
|
|
8
8
|
codeMirrorDisabled?: boolean;
|
|
9
9
|
codeMirrorStyles?: {};
|
|
10
|
+
onSave?: ((text: string) => void) | undefined;
|
|
10
11
|
};
|
|
11
12
|
events: {
|
|
12
13
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<script>import Tooltip from "./Tooltip.svelte";
|
|
11
|
+
import Sensitive from "./Sensitive.svelte";
|
|
11
12
|
import {
|
|
12
13
|
WalletOutline,
|
|
13
14
|
FingerprintOutline,
|
|
@@ -54,7 +55,7 @@ function copy(e) {
|
|
|
54
55
|
{:else if type === HashType.Address}
|
|
55
56
|
<ClipboardOutline size="sm" />
|
|
56
57
|
{/if}
|
|
57
|
-
<div>{displayValue}</div>
|
|
58
|
+
<Sensitive><div>{displayValue}</div></Sensitive>
|
|
58
59
|
</button>
|
|
59
60
|
|
|
60
61
|
{#if showCopiedMessage}
|
|
@@ -79,7 +80,7 @@ function copy(e) {
|
|
|
79
80
|
{:else if type === HashType.Address}
|
|
80
81
|
<ClipboardOutline size="sm" />
|
|
81
82
|
{/if}
|
|
82
|
-
<div>{value}</div>
|
|
83
|
+
<Sensitive><div>{value}</div></Sensitive>
|
|
83
84
|
</div>
|
|
84
85
|
</Tooltip>
|
|
85
86
|
{/if}
|