@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.
Files changed (176) hide show
  1. package/README.md +14 -6
  2. package/dist/__fixtures__/settings.yaml +18 -20
  3. package/dist/__mocks__/MockCodeMirrorEditor.svelte +17 -0
  4. package/dist/__mocks__/MockCodeMirrorEditor.svelte.d.ts +21 -0
  5. package/dist/__mocks__/MockComponent.js +1 -1
  6. package/dist/__mocks__/MockComponent.svelte +7 -3
  7. package/dist/__mocks__/MockComponent.svelte.d.ts +1 -0
  8. package/dist/__mocks__/mockWeb3Config.d.ts +1 -1
  9. package/dist/__mocks__/mockWeb3Config.js +10 -7
  10. package/dist/__mocks__/queries.js +9 -9
  11. package/dist/__mocks__/stores.d.ts +4 -4
  12. package/dist/__mocks__/stores.js +40 -40
  13. package/dist/app.css +3 -3
  14. package/dist/components/ButtonDarkMode.svelte +7 -1
  15. package/dist/components/ButtonScrub.svelte +22 -0
  16. package/dist/components/ButtonScrub.svelte.d.ts +25 -0
  17. package/dist/components/ButtonVaultLink.svelte +3 -2
  18. package/dist/components/ButtonVaultLink.svelte.d.ts +2 -2
  19. package/dist/components/CodeMirrorRainlang.svelte +19 -2
  20. package/dist/components/CodeMirrorRainlang.svelte.d.ts +2 -1
  21. package/dist/components/Hash.svelte +3 -2
  22. package/dist/components/{ListViewOrderbookFilters.svelte → ListViewRaindexFilters.svelte} +7 -7
  23. package/dist/components/{ListViewOrderbookFilters.svelte.d.ts → ListViewRaindexFilters.svelte.d.ts} +7 -7
  24. package/dist/components/LocalDbStatusBadge.svelte.d.ts +1 -1
  25. package/dist/components/LocalDbStatusCard.svelte +7 -4
  26. package/dist/components/LocalDbStatusCard.svelte.d.ts +2 -2
  27. package/dist/components/LocalDbStatusModal.svelte +16 -14
  28. package/dist/components/LocalDbStatusModal.svelte.d.ts +2 -2
  29. package/dist/components/OrderOrVaultHash.svelte +2 -2
  30. package/dist/components/OrderOrVaultHash.svelte.d.ts +2 -2
  31. package/dist/components/Sensitive.svelte +16 -0
  32. package/dist/components/Sensitive.svelte.d.ts +28 -0
  33. package/dist/components/TanstackAppTable.svelte +146 -87
  34. package/dist/components/TanstackAppTable.svelte.d.ts +1 -1
  35. package/dist/components/VaultBalanceChangeTypeFilter.svelte +1 -1
  36. package/dist/components/VaultBalanceChangeTypeFilter.svelte.d.ts +1 -1
  37. package/dist/components/VaultCard.svelte +1 -1
  38. package/dist/components/VaultCard.svelte.d.ts +1 -1
  39. package/dist/components/charts/OrderTradesChart.svelte +116 -97
  40. package/dist/components/charts/OrderTradesChart.svelte.d.ts +2 -2
  41. package/dist/components/charts/transformAndSortData.d.ts +1 -1
  42. package/dist/components/charts/transformAndSortData.js +19 -19
  43. package/dist/components/deployment/DeploymentSteps.svelte +5 -2
  44. package/dist/components/deployment/DeploymentSteps.svelte.d.ts +1 -1
  45. package/dist/components/deployment/DeploymentsSection.svelte.d.ts +1 -1
  46. package/dist/components/deployment/DepositInput.svelte +1 -1
  47. package/dist/components/deployment/DepositInput.svelte.d.ts +1 -1
  48. package/dist/components/deployment/FieldDefinitionInput.svelte +1 -1
  49. package/dist/components/deployment/FieldDefinitionInput.svelte.d.ts +1 -1
  50. package/dist/components/deployment/OrderPage.svelte.d.ts +1 -1
  51. package/dist/components/deployment/SelectToken.svelte.d.ts +1 -1
  52. package/dist/components/deployment/TokenIOInput.svelte +1 -1
  53. package/dist/components/deployment/TokenIOInput.svelte.d.ts +1 -1
  54. package/dist/components/deployment/TokenSelectionModal.svelte.d.ts +1 -1
  55. package/dist/components/detail/OrderDetail.svelte +12 -6
  56. package/dist/components/detail/OrderDetail.svelte.d.ts +2 -2
  57. package/dist/components/detail/TanstackOrderQuote.svelte +22 -0
  58. package/dist/components/detail/TanstackOrderQuote.svelte.d.ts +1 -1
  59. package/dist/components/detail/VaultDetail.svelte +12 -10
  60. package/dist/components/detail/VaultDetail.svelte.d.ts +2 -2
  61. package/dist/components/dropdown/{DropdownOrderbooksFilter.svelte → DropdownRaindexesFilter.svelte} +54 -54
  62. package/dist/components/dropdown/DropdownRaindexesFilter.svelte.d.ts +25 -0
  63. package/dist/components/dropdown/DropdownTokensFilter.svelte.d.ts +1 -1
  64. package/dist/components/icon/Refresh.svelte +2 -1
  65. package/dist/components/icon/Refresh.svelte.d.ts +1 -0
  66. package/dist/components/input/InputTokenAmount.svelte +16 -1
  67. package/dist/components/input/InputTokenAmount.svelte.d.ts +1 -1
  68. package/dist/components/tables/OrderTradesListTable.svelte +113 -98
  69. package/dist/components/tables/OrderTradesListTable.svelte.d.ts +1 -1
  70. package/dist/components/tables/OrderVaultsVolTable.svelte +1 -1
  71. package/dist/components/tables/OrderVaultsVolTable.svelte.d.ts +1 -1
  72. package/dist/components/tables/OrdersListTable.svelte +19 -17
  73. package/dist/components/tables/OrdersListTable.svelte.d.ts +1 -1
  74. package/dist/components/tables/VaultBalanceChangesTable.svelte +1 -1
  75. package/dist/components/tables/VaultBalanceChangesTable.svelte.d.ts +1 -1
  76. package/dist/components/tables/VaultsListTable.svelte +24 -21
  77. package/dist/components/tables/VaultsListTable.svelte.d.ts +2 -2
  78. package/dist/components/transactions/FixedBottomTransaction.svelte +1 -0
  79. package/dist/components/transactions/getStatusEmoji.d.ts +1 -1
  80. package/dist/components/transactions/getStatusEmoji.js +13 -13
  81. package/dist/consts.js +1 -1
  82. package/dist/errors/DeploymentStepsError.js +3 -3
  83. package/dist/errors/index.d.ts +1 -1
  84. package/dist/errors/index.js +1 -1
  85. package/dist/hooks/useLocalDb.d.ts +1 -1
  86. package/dist/hooks/useLocalDb.js +3 -3
  87. package/dist/hooks/useRaindexClient.d.ts +1 -1
  88. package/dist/hooks/useRaindexClient.js +4 -4
  89. package/dist/hooks/useRaindexOrderBuilder.d.ts +1 -1
  90. package/dist/hooks/useRaindexOrderBuilder.js +4 -4
  91. package/dist/index.d.ts +122 -114
  92. package/dist/index.js +115 -109
  93. package/dist/models/Transaction.d.ts +4 -4
  94. package/dist/models/Transaction.js +9 -9
  95. package/dist/providers/RaindexClientProvider.svelte +1 -1
  96. package/dist/providers/RaindexClientProvider.svelte.d.ts +1 -1
  97. package/dist/providers/RaindexOrderBuilderProvider.svelte +1 -1
  98. package/dist/providers/RaindexOrderBuilderProvider.svelte.d.ts +1 -1
  99. package/dist/providers/dotrainRegistry/DotrainRegistryProvider.svelte.d.ts +1 -1
  100. package/dist/providers/dotrainRegistry/context.d.ts +2 -2
  101. package/dist/providers/dotrainRegistry/context.js +13 -10
  102. package/dist/providers/dotrainRegistry/useDotrainRegistry.d.ts +1 -1
  103. package/dist/providers/dotrainRegistry/useDotrainRegistry.js +8 -8
  104. package/dist/providers/registry/RegistryManager.js +8 -7
  105. package/dist/providers/registry/context.d.ts +1 -1
  106. package/dist/providers/registry/context.js +9 -9
  107. package/dist/providers/registry/useRegistry.d.ts +1 -1
  108. package/dist/providers/registry/useRegistry.js +5 -5
  109. package/dist/providers/toasts/context.d.ts +2 -2
  110. package/dist/providers/toasts/context.js +4 -4
  111. package/dist/providers/toasts/useToasts.d.ts +1 -1
  112. package/dist/providers/toasts/useToasts.js +4 -4
  113. package/dist/providers/transactions/TransactionManager.d.ts +14 -15
  114. package/dist/providers/transactions/TransactionManager.js +107 -107
  115. package/dist/providers/transactions/context.d.ts +1 -1
  116. package/dist/providers/transactions/context.js +4 -4
  117. package/dist/providers/transactions/useTransactions.js +2 -2
  118. package/dist/providers/wallet/context.d.ts +1 -1
  119. package/dist/providers/wallet/context.js +11 -11
  120. package/dist/providers/wallet/useAccount.js +27 -27
  121. package/dist/queries/keys.js +10 -10
  122. package/dist/queries/queryClient.d.ts +1 -1
  123. package/dist/queries/queryClient.js +8 -8
  124. package/dist/services/awaitTransactionIndexing.d.ts +8 -8
  125. package/dist/services/awaitTransactionIndexing.js +10 -8
  126. package/dist/services/getExplorerLink.js +2 -2
  127. package/dist/services/handleShareChoices.d.ts +1 -1
  128. package/dist/services/handleShareChoices.js +4 -4
  129. package/dist/services/historicalOrderCharts.d.ts +2 -2
  130. package/dist/services/historicalOrderCharts.js +260 -201
  131. package/dist/services/index.d.ts +5 -3
  132. package/dist/services/index.js +3 -2
  133. package/dist/services/loadRegistryUrl.d.ts +1 -1
  134. package/dist/services/loadRegistryUrl.js +5 -5
  135. package/dist/services/pairTradesChartData.d.ts +2 -2
  136. package/dist/services/pairTradesChartData.js +28 -24
  137. package/dist/services/registry.d.ts +1 -1
  138. package/dist/services/registry.js +10 -10
  139. package/dist/services/time.d.ts +1 -1
  140. package/dist/services/time.js +35 -35
  141. package/dist/services/validateAmount.d.ts +30 -0
  142. package/dist/services/validateAmount.js +53 -0
  143. package/dist/storesGeneric/cachedWritableStore.d.ts +2 -2
  144. package/dist/storesGeneric/cachedWritableStore.js +3 -3
  145. package/dist/storesGeneric/scrub.d.ts +14 -0
  146. package/dist/storesGeneric/scrub.js +22 -0
  147. package/dist/test/matchers.d.ts +2 -2
  148. package/dist/test/matchers.js +2 -2
  149. package/dist/types/account.d.ts +2 -2
  150. package/dist/types/appStores.d.ts +3 -3
  151. package/dist/types/modal.d.ts +3 -3
  152. package/dist/types/order.d.ts +1 -1
  153. package/dist/types/toast.d.ts +2 -2
  154. package/dist/types/tokenBalance.d.ts +1 -1
  155. package/dist/types/transaction.d.ts +4 -4
  156. package/dist/utils/breadcrumbs.js +2 -2
  157. package/dist/utils/codeMirrorThemes.js +80 -74
  158. package/dist/utils/configHelpers.d.ts +1 -1
  159. package/dist/utils/configHelpers.js +6 -6
  160. package/dist/utils/constructHashLink.d.ts +3 -3
  161. package/dist/utils/constructHashLink.js +39 -37
  162. package/dist/utils/getNetworkName.js +5 -5
  163. package/dist/utils/hex.js +1 -1
  164. package/dist/utils/lightweightChartsThemes.d.ts +1 -1
  165. package/dist/utils/lightweightChartsThemes.js +11 -11
  166. package/dist/utils/localDbStatus.d.ts +26 -0
  167. package/dist/utils/localDbStatus.js +22 -0
  168. package/dist/utils/number.js +5 -3
  169. package/dist/utils/stripTrailingWhitespace.d.ts +16 -0
  170. package/dist/utils/stripTrailingWhitespace.js +22 -0
  171. package/dist/utils/tokens.d.ts +1 -1
  172. package/dist/utils/tokens.js +1 -1
  173. package/dist/utils/vaultBalanceChangeLabels.d.ts +1 -1
  174. package/dist/utils/vaultBalanceChangeLabels.js +11 -11
  175. package/package.json +89 -89
  176. package/dist/components/dropdown/DropdownOrderbooksFilter.svelte.d.ts +0 -25
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { RaindexClient } from '@rainlanguage/orderbook';
2
+ import { RaindexClient } from '@rainlanguage/raindex';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  raindexClient: RaindexClient;
@@ -1,5 +1,5 @@
1
1
  <script>import { setContext } from "svelte";
2
- import { RaindexOrderBuilder } from "@rainlanguage/orderbook";
2
+ import { RaindexOrderBuilder } from "@rainlanguage/raindex";
3
3
  import { RAINDEX_ORDER_BUILDER_CONTEXT_KEY } from "../hooks/useRaindexOrderBuilder";
4
4
  export let builder;
5
5
  setContext(RAINDEX_ORDER_BUILDER_CONTEXT_KEY, builder);
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { RaindexOrderBuilder } from '@rainlanguage/orderbook';
2
+ import { RaindexOrderBuilder } from "@rainlanguage/raindex";
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  builder: RaindexOrderBuilder;
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import type { DotrainRegistry } from '@rainlanguage/orderbook';
2
+ import type { DotrainRegistry } from '@rainlanguage/raindex';
3
3
  import type { RegistryManager } from '../registry/RegistryManager';
4
4
  declare const __propDef: {
5
5
  props: {
@@ -1,5 +1,5 @@
1
- import type { DotrainRegistry } from '@rainlanguage/orderbook';
2
- import type { RegistryManager } from '../registry/RegistryManager';
1
+ import type { DotrainRegistry } from "@rainlanguage/raindex";
2
+ import type { RegistryManager } from "../registry/RegistryManager";
3
3
  export type DotrainRegistryContext = {
4
4
  registry: DotrainRegistry | null;
5
5
  error?: string;
@@ -1,28 +1,31 @@
1
- import { getContext, setContext } from 'svelte';
2
- const DOTRAIN_REGISTRY_CONTEXT_KEY = 'dotrain-registry-context';
1
+ import { getContext, setContext } from "svelte";
2
+ const DOTRAIN_REGISTRY_CONTEXT_KEY = "dotrain-registry-context";
3
3
  export const setDotrainRegistryContext = (context) => {
4
4
  setContext(DOTRAIN_REGISTRY_CONTEXT_KEY, context);
5
5
  };
6
6
  export const getDotrainRegistryContext = () => {
7
7
  const ctx = getContext(DOTRAIN_REGISTRY_CONTEXT_KEY);
8
8
  if (!ctx) {
9
- throw new Error('Dotrain registry context not found. Did you forget to wrap your app in DotrainRegistryProvider?');
9
+ throw new Error("Dotrain registry context not found. Did you forget to wrap your app in DotrainRegistryProvider?");
10
10
  }
11
11
  return ctx;
12
12
  };
13
13
  if (import.meta.vitest) {
14
14
  const { describe, it, expect, vi, beforeEach } = import.meta.vitest;
15
- vi.mock('svelte', async (importOriginal) => ({
15
+ vi.mock("svelte", async (importOriginal) => ({
16
16
  ...(await importOriginal()),
17
- getContext: vi.fn()
17
+ getContext: vi.fn(),
18
18
  }));
19
- describe('getDotrainRegistryContext', () => {
19
+ describe("getDotrainRegistryContext", () => {
20
20
  const mockGetContext = vi.mocked(getContext);
21
21
  beforeEach(() => {
22
22
  mockGetContext.mockReset();
23
23
  });
24
- it('should return the context when it exists', () => {
25
- const mockCtx = { registry: null, manager: {} };
24
+ it("should return the context when it exists", () => {
25
+ const mockCtx = {
26
+ registry: null,
27
+ manager: {},
28
+ };
26
29
  mockGetContext.mockImplementation((key) => {
27
30
  if (key === DOTRAIN_REGISTRY_CONTEXT_KEY)
28
31
  return mockCtx;
@@ -32,9 +35,9 @@ if (import.meta.vitest) {
32
35
  expect(mockGetContext).toHaveBeenCalledWith(DOTRAIN_REGISTRY_CONTEXT_KEY);
33
36
  expect(result).toEqual(mockCtx);
34
37
  });
35
- it('should throw an error when context is not set', () => {
38
+ it("should throw an error when context is not set", () => {
36
39
  mockGetContext.mockReturnValue(undefined);
37
- expect(() => getDotrainRegistryContext()).toThrow('Dotrain registry context not found. Did you forget to wrap your app in DotrainRegistryProvider?');
40
+ expect(() => getDotrainRegistryContext()).toThrow("Dotrain registry context not found. Did you forget to wrap your app in DotrainRegistryProvider?");
38
41
  });
39
42
  });
40
43
  }
@@ -1,4 +1,4 @@
1
- import { type DotrainRegistryContext } from './context';
1
+ import { type DotrainRegistryContext } from "./context";
2
2
  /**
3
3
  * Hook to access the current Dotrain registry context.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { getDotrainRegistryContext } from './context';
1
+ import { getDotrainRegistryContext, } from "./context";
2
2
  /**
3
3
  * Hook to access the current Dotrain registry context.
4
4
  */
@@ -7,24 +7,24 @@ export function useDotrainRegistry() {
7
7
  }
8
8
  if (import.meta.vitest) {
9
9
  const { describe, it, expect, vi, beforeEach } = import.meta.vitest;
10
- vi.mock('./context', () => ({
11
- getDotrainRegistryContext: vi.fn()
10
+ vi.mock("./context", () => ({
11
+ getDotrainRegistryContext: vi.fn(),
12
12
  }));
13
- describe('useDotrainRegistry', () => {
13
+ describe("useDotrainRegistry", () => {
14
14
  const mockGetContext = vi.mocked(getDotrainRegistryContext);
15
15
  beforeEach(() => {
16
16
  mockGetContext.mockReset();
17
17
  });
18
- it('should return the registry context', () => {
18
+ it("should return the registry context", () => {
19
19
  const mockContext = {
20
20
  registry: null,
21
21
  manager: {
22
- getCurrentRegistry: vi.fn().mockReturnValue(''),
22
+ getCurrentRegistry: vi.fn().mockReturnValue(""),
23
23
  setRegistry: vi.fn(),
24
24
  resetToDefault: vi.fn(),
25
25
  updateUrlWithRegistry: vi.fn(),
26
- isCustomRegistry: vi.fn().mockReturnValue(false)
27
- }
26
+ isCustomRegistry: vi.fn().mockReturnValue(false),
27
+ },
28
28
  };
29
29
  mockGetContext.mockReturnValue(mockContext);
30
30
  const result = useDotrainRegistry();
@@ -7,7 +7,7 @@ export class RegistryManager {
7
7
  /** The currently selected registry URL */
8
8
  currentRegistry;
9
9
  /** Key used for localStorage and URL parameters */
10
- static STORAGE_KEY = 'registry';
10
+ static STORAGE_KEY = "registry";
11
11
  /**
12
12
  * Create a new RegistryManager
13
13
  * @param defaultRegistry The default registry URL to use.
@@ -38,7 +38,7 @@ export class RegistryManager {
38
38
  return new URL(window.location.href).searchParams.get(RegistryManager.STORAGE_KEY);
39
39
  }
40
40
  catch (error) {
41
- throw new Error('Failed to get registry parameter: ' +
41
+ throw new Error("Failed to get registry parameter: " +
42
42
  (error instanceof Error ? error.message : String(error)));
43
43
  }
44
44
  }
@@ -52,7 +52,7 @@ export class RegistryManager {
52
52
  localStorage.setItem(RegistryManager.STORAGE_KEY, registry);
53
53
  }
54
54
  catch (error) {
55
- throw new Error('Failed to save to localStorage: ' +
55
+ throw new Error("Failed to save to localStorage: " +
56
56
  (error instanceof Error ? error.message : String(error)));
57
57
  }
58
58
  }
@@ -66,7 +66,8 @@ export class RegistryManager {
66
66
  return localStorage.getItem(RegistryManager.STORAGE_KEY);
67
67
  }
68
68
  catch (error) {
69
- throw new Error('Failed to access localStorage: ' + (error instanceof Error ? error.message : String(error)));
69
+ throw new Error("Failed to access localStorage: " +
70
+ (error instanceof Error ? error.message : String(error)));
70
71
  }
71
72
  }
72
73
  /**
@@ -95,7 +96,7 @@ export class RegistryManager {
95
96
  localStorage.removeItem(RegistryManager.STORAGE_KEY);
96
97
  }
97
98
  catch (error) {
98
- throw new Error('Failed to clear registry from localStorage: ' +
99
+ throw new Error("Failed to clear registry from localStorage: " +
99
100
  (error instanceof Error ? error.message : String(error)));
100
101
  }
101
102
  this.updateUrlWithRegistry(null);
@@ -114,10 +115,10 @@ export class RegistryManager {
114
115
  else {
115
116
  url.searchParams.delete(RegistryManager.STORAGE_KEY);
116
117
  }
117
- window.history.pushState({}, '', url.toString());
118
+ window.history.pushState({}, "", url.toString());
118
119
  }
119
120
  catch (error) {
120
- throw new Error('Failed to update URL parameter: ' +
121
+ throw new Error("Failed to update URL parameter: " +
121
122
  (error instanceof Error ? error.message : String(error)));
122
123
  }
123
124
  }
@@ -1,4 +1,4 @@
1
- import type { RegistryManager } from './RegistryManager';
1
+ import type { RegistryManager } from "./RegistryManager";
2
2
  export declare const REGISTRY_KEY = "registry_key";
3
3
  /**
4
4
  * Retrieves the registry manager directly from Svelte's context
@@ -1,12 +1,12 @@
1
- import { getContext, setContext } from 'svelte';
2
- export const REGISTRY_KEY = 'registry_key';
1
+ import { getContext, setContext } from "svelte";
2
+ export const REGISTRY_KEY = "registry_key";
3
3
  /**
4
4
  * Retrieves the registry manager directly from Svelte's context
5
5
  */
6
6
  export const getRegistryContext = () => {
7
7
  const registry = getContext(REGISTRY_KEY);
8
8
  if (!registry) {
9
- throw new Error('No registry manager was found in Svelte context. Did you forget to wrap your component with RegistryProvider?');
9
+ throw new Error("No registry manager was found in Svelte context. Did you forget to wrap your component with RegistryProvider?");
10
10
  }
11
11
  return registry;
12
12
  };
@@ -18,16 +18,16 @@ export const setRegistryContext = (registry) => {
18
18
  };
19
19
  if (import.meta.vitest) {
20
20
  const { describe, it, expect, vi, beforeEach } = import.meta.vitest;
21
- vi.mock('svelte', async (importOriginal) => ({
21
+ vi.mock("svelte", async (importOriginal) => ({
22
22
  ...(await importOriginal()),
23
- getContext: vi.fn()
23
+ getContext: vi.fn(),
24
24
  }));
25
- describe('getRegistryContext', () => {
25
+ describe("getRegistryContext", () => {
26
26
  const mockGetContext = vi.mocked(getContext);
27
27
  beforeEach(() => {
28
28
  mockGetContext.mockReset();
29
29
  });
30
- it('should return the registry from context when it exists', () => {
30
+ it("should return the registry from context when it exists", () => {
31
31
  const mockRegistry = {};
32
32
  mockGetContext.mockImplementation((key) => {
33
33
  if (key === REGISTRY_KEY)
@@ -38,9 +38,9 @@ if (import.meta.vitest) {
38
38
  expect(mockGetContext).toHaveBeenCalledWith(REGISTRY_KEY);
39
39
  expect(result).toEqual(mockRegistry);
40
40
  });
41
- it('should throw an error when registry is not in context', () => {
41
+ it("should throw an error when registry is not in context", () => {
42
42
  mockGetContext.mockReturnValue(undefined);
43
- expect(() => getRegistryContext()).toThrow('No registry manager was found in Svelte context. Did you forget to wrap your component with RegistryProvider?');
43
+ expect(() => getRegistryContext()).toThrow("No registry manager was found in Svelte context. Did you forget to wrap your component with RegistryProvider?");
44
44
  });
45
45
  });
46
46
  }
@@ -1,4 +1,4 @@
1
- import type { RegistryManager } from './RegistryManager';
1
+ import type { RegistryManager } from "./RegistryManager";
2
2
  /**
3
3
  * Hook to access registry manager information from context
4
4
  * Must be used within a component that is a child of RegistryProvider
@@ -1,4 +1,4 @@
1
- import { getRegistryContext } from './context';
1
+ import { getRegistryContext } from "./context";
2
2
  /**
3
3
  * Hook to access registry manager information from context
4
4
  * Must be used within a component that is a child of RegistryProvider
@@ -10,15 +10,15 @@ export function useRegistry() {
10
10
  }
11
11
  if (import.meta.vitest) {
12
12
  const { describe, it, expect, vi, beforeEach } = import.meta.vitest;
13
- vi.mock('./context', () => ({
14
- getRegistryContext: vi.fn()
13
+ vi.mock("./context", () => ({
14
+ getRegistryContext: vi.fn(),
15
15
  }));
16
- describe('useRegistry', () => {
16
+ describe("useRegistry", () => {
17
17
  const mockGetRegistryContext = vi.mocked(getRegistryContext);
18
18
  beforeEach(() => {
19
19
  mockGetRegistryContext.mockReset();
20
20
  });
21
- it('should return registry', () => {
21
+ it("should return registry", () => {
22
22
  const mockRegistry = {};
23
23
  mockGetRegistryContext.mockReturnValue(mockRegistry);
24
24
  const result = useRegistry();
@@ -1,5 +1,5 @@
1
- import { type Writable } from 'svelte/store';
2
- import type { ToastProps } from '../../types/toast';
1
+ import { type Writable } from "svelte/store";
2
+ import type { ToastProps } from "../../types/toast";
3
3
  export declare const TOASTS_KEY = "rain:ui-components:toasts";
4
4
  /**
5
5
  * Retrieves the toasts store from Svelte's context
@@ -1,13 +1,13 @@
1
- import { getContext, setContext } from 'svelte';
2
- import {} from 'svelte/store';
3
- export const TOASTS_KEY = 'rain:ui-components:toasts';
1
+ import { getContext, setContext } from "svelte";
2
+ import {} from "svelte/store";
3
+ export const TOASTS_KEY = "rain:ui-components:toasts";
4
4
  /**
5
5
  * Retrieves the toasts store from Svelte's context
6
6
  */
7
7
  export function getToastsContext() {
8
8
  const toasts = getContext(TOASTS_KEY);
9
9
  if (!toasts) {
10
- throw new Error('No toasts context found. Did you forget to wrap your component with ToastProvider?');
10
+ throw new Error("No toasts context found. Did you forget to wrap your component with ToastProvider?");
11
11
  }
12
12
  return toasts;
13
13
  }
@@ -1,4 +1,4 @@
1
- import type { ToastProps } from '../../types/toast';
1
+ import type { ToastProps } from "../../types/toast";
2
2
  /**
3
3
  * Hook for managing toast notifications in the application.
4
4
  * Provides functionality to add, remove, and access toast notifications.
@@ -1,4 +1,4 @@
1
- import { getToastsContext } from './context';
1
+ import { getToastsContext } from "./context";
2
2
  /**
3
3
  * Hook for managing toast notifications in the application.
4
4
  * Provides functionality to add, remove, and access toast notifications.
@@ -50,14 +50,14 @@ export function useToasts() {
50
50
  addToast({
51
51
  message,
52
52
  detail,
53
- type: 'error',
54
- color: 'red'
53
+ type: "error",
54
+ color: "red",
55
55
  });
56
56
  };
57
57
  return {
58
58
  toasts,
59
59
  addToast,
60
60
  removeToast,
61
- errToast
61
+ errToast,
62
62
  };
63
63
  }
@@ -1,10 +1,10 @@
1
- import { type Readable } from 'svelte/store';
2
- import type { QueryClient } from '@tanstack/svelte-query';
3
- import { type Transaction } from '../../models/Transaction';
4
- import type { InternalTransactionArgs, IndexingContext } from '../../types/transaction';
5
- import type { Config } from '@wagmi/core';
6
- import type { ToastLink, ToastProps } from '../../types/toast';
7
- import { type RaindexVault, type RaindexOrder, RaindexClient, type Address, Float, type WasmEncodedResult } from '@rainlanguage/orderbook';
1
+ import { type Readable } from "svelte/store";
2
+ import type { QueryClient } from "@tanstack/svelte-query";
3
+ import { type Transaction } from "../../models/Transaction";
4
+ import type { InternalTransactionArgs, IndexingContext } from "../../types/transaction";
5
+ import type { Config } from "@wagmi/core";
6
+ import type { ToastLink, ToastProps } from "../../types/toast";
7
+ import { type RaindexVault, type RaindexOrder, RaindexClient, type Address, Float, type WasmEncodedResult } from "@rainlanguage/raindex";
8
8
  /**
9
9
  * Function type for adding toast notifications to the UI.
10
10
  * @param toast - The toast notification configuration object.
@@ -13,11 +13,10 @@ import { type RaindexVault, type RaindexOrder, RaindexClient, type Address, Floa
13
13
  * @param toast.color - The color theme of the toast.
14
14
  * @param toast.links - Optional array of links to display in the toast.
15
15
  */
16
- export type AddToastFunction = (toast: Omit<ToastProps, 'id'>) => void;
16
+ export type AddToastFunction = (toast: Omit<ToastProps, "id">) => void;
17
17
  /**
18
18
  * Creates an indexing function that wraps SDK-based polling logic.
19
- * The SDK handles local-DB-first polling followed by subgraph fallback internally,
20
- * so we only need to call it once.
19
+ * The SDK handles the retry loop internally, so we only need to call it once.
21
20
  *
22
21
  * @param options Configuration for SDK-based indexing
23
22
  * @param options.call Function that calls the SDK method (e.g. getAddOrdersForTransaction)
@@ -52,7 +51,7 @@ export declare class TransactionManager {
52
51
  */
53
52
  constructor(queryClient: QueryClient, addToast: AddToastFunction, wagmiConfig: Config);
54
53
  /**
55
- * Creates and initializes a new transaction for removing an order from the orderbook.
54
+ * Creates and initializes a new transaction for removing an order from the raindex.
56
55
  * @param args - Configuration for the remove order transaction.
57
56
  * @param args.txHash - Hash of the transaction to track.
58
57
  * @param args.chainId - Chain ID where the transaction is being executed.
@@ -94,12 +93,12 @@ export declare class TransactionManager {
94
93
  /**
95
94
  * Creates a multicall withdrawal transaction.
96
95
  *
97
- * Precondition: all provided vaults must share the same Raindex orderbook.
96
+ * Precondition: all provided vaults must share the same raindex.
98
97
  * This is enforced upstream in handleVaultsWithdrawAll.ts:
99
- * if (vaults.some(v => v.orderbook !== vaults[0].orderbook)) { … }
98
+ * if (vaults.some(v => v.raindex !== vaults[0].raindex)) { … }
100
99
  *
101
100
  * @param args.chainId the target chain ID
102
- * @param args.vaults list of RaindexVault instances (must share an orderbook)
101
+ * @param args.vaults list of RaindexVault instances (must share a raindex)
103
102
  * @param args.txHash the transaction hash to wrap
104
103
  * @param args.queryKey cache key for invalidation
105
104
  * @param args.raindexClient Raindex API client * @example
@@ -181,7 +180,7 @@ export declare class TransactionManager {
181
180
  * });
182
181
  */
183
182
  createAddOrderTransaction(args: InternalTransactionArgs & {
184
- orderbook: Address;
183
+ raindex: Address;
185
184
  raindexClient: RaindexClient;
186
185
  }): Promise<Transaction>;
187
186
  /**