@dhedge/trading-widget 4.0.11 → 4.1.1

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 (31) hide show
  1. package/README.md +13 -9
  2. package/core-kit/const/currency.d.ts +1 -0
  3. package/core-kit/utils/formatter.d.ts +7 -0
  4. package/core-kit/utils/token.d.ts +1 -0
  5. package/index.cjs +10 -10
  6. package/index.js +3984 -3869
  7. package/package.json +1 -1
  8. package/style.css +1 -1
  9. package/trading-widget/components/common/balance/balance.d.ts +1 -1
  10. package/trading-widget/components/common/layout/index.d.ts +0 -2
  11. package/trading-widget/components/widget/widget-buttons/index.d.ts +1 -0
  12. package/trading-widget/components/widget/widget-buttons/limit-order-button/limit-order-button.d.ts +3 -0
  13. package/trading-widget/components/widget/widget-input/index.d.ts +3 -0
  14. package/trading-widget/components/widget/widget-input/input-arrow/input-arrow.d.ts +2 -0
  15. package/trading-widget/components/widget/widget-input/input-arrow/input-arrow.hooks.d.ts +3 -0
  16. package/trading-widget/components/widget/widget-input/receive-token-balance/receive-token-balance.d.ts +2 -0
  17. package/trading-widget/components/widget/widget-input/receive-token-balance/receive-token-balance.hooks.d.ts +4 -0
  18. package/trading-widget/components/widget/widget-input/send-token-balance/send-token-balance.d.ts +2 -0
  19. package/trading-widget/components/widget/widget-input/send-token-balance/send-token-balance.hooks.d.ts +4 -0
  20. package/trading-widget/components/widget/widget-input/widget-input.d.ts +2 -2
  21. package/trading-widget/components/withdraw/init-step/button/valid-init-withdraw-button/valid-init-withdraw-button.hooks.d.ts +0 -2
  22. package/trading-widget/providers/component-provider/component-provider.d.ts +1 -0
  23. package/trading-widget/providers/component-provider/component-provider.hooks.d.ts +1 -0
  24. package/trading-widget/providers/component-provider/component-provider.types.d.ts +4 -0
  25. package/trading-widget/providers/theme-provider/theme-provider.types.d.ts +15 -2
  26. package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +5 -3
  27. package/trading-widget/components/common/layout/balance/balance.d.ts +0 -2
  28. package/trading-widget/components/deposit/balance/balance.d.ts +0 -2
  29. package/trading-widget/components/deposit/balance/balance.hooks.d.ts +0 -4
  30. package/trading-widget/components/withdraw/init-step/balance/init-withdraw-balance.d.ts +0 -2
  31. package/trading-widget/components/withdraw/init-step/balance/init-withdraw-balance.hooks.d.ts +0 -4
package/README.md CHANGED
@@ -454,12 +454,16 @@ path: `component.actionButton[name]`
454
454
 
455
455
  path: `component.meta[name]`
456
456
 
457
- > | name | type | default value | description |
458
- > | --------------------- | ------ | ------------------------------------ | -------------------- |
459
- > | `size.gap` | string | `global.size.gap` | Meta flex gap |
460
- > | `size.px` | string | `global.size.spacer * 3` | Meta padding inline |
461
- > | `color.linkTextColor` | string | `global.color.colorBgAccentFrom` | Meta link text color |
462
- > | `color.panelBgHover` | string | `config.global.color.colorBgNeutral` | Meta panel hover bg |
457
+ > | name | type | default value | description |
458
+ > | --------------------------- | ------ | ------------------------------------ | --------------------------- |
459
+ > | `size.gap` | string | `global.size.gap` | Meta flex gap |
460
+ > | `size.px` | string | `global.size.spacer * 3` | Meta padding inline |
461
+ > | `size.fontSize` | string | `global.size.fontSizeXs` | Meta font size |
462
+ > | `size.lineHeight` | string | `global.size.lineHeightXs` | Meta line height |
463
+ > | `size.emphasisedFontSize` | string | `global.size.fontSizeSm` | Meta font size emphasised |
464
+ > | `size.emphasisedLineHeight` | string | `global.size.lineHeightSm` | Meta line height emphasised |
465
+ > | `color.linkTextColor` | string | `global.color.colorBgAccentFrom` | Meta link text color |
466
+ > | `color.panelBgHover` | string | `config.global.color.colorBgNeutral` | Meta panel hover bg |
463
467
 
464
468
  ###### Source: `packages/trading-widget/src/trading-widget/providers/theme-provider/theme-provider.tsx`
465
469
 
@@ -507,12 +511,9 @@ path: `component.meta[name]`
507
511
  > | `lengthenLockup` | string | Lengthen lockup to remove entry fee | |
508
512
  > | `deposit` | string | Buy | |
509
513
  > | `withdraw` | string | Sell | |
510
- > | `yourBalance` | string | Your Balance | |
511
514
  > | `max` | string | Max | |
512
515
  > | `allAssets` | string | All Assets | |
513
516
  > | `all` | string | All | |
514
- > | `payWith` | string | Pay with | |
515
- > | `buyEstimated` | string | Buy (estimated) | |
516
517
  > | `sell` | string | Sell | |
517
518
  > | `receiveEstimated` | string | Receive (estimated) | |
518
519
  > | `confirmInWallet` | string | Please confirm in wallet | |
@@ -582,6 +583,9 @@ path: `component.meta[name]`
582
583
  > | `paidLabel` | string | Paid | |
583
584
  > | `priceLabel` | string | Price | |
584
585
  > | `transactionLabel` | string | Transaction | |
586
+ > | `stopOrder` | string | Stop Order | |
587
+ > | `send` | string | Send | |
588
+ > | `cooldown` | string | Cooldown | |
585
589
 
586
590
  ###### Source: `packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.tsx`
587
591
 
@@ -1,3 +1,4 @@
1
1
  import type { ApyCurrency } from '../types';
2
2
  export declare const CURRENCY_SYMBOL_MAP: Record<ApyCurrency, string>;
3
3
  export declare const CURRENCY_DECIMALS_MAP: Record<ApyCurrency, number>;
4
+ export declare const STABLE_TOKEN_SYMBOLS: string[];
@@ -20,3 +20,10 @@ export declare function formatBalanceInUsd(balance: string | undefined, tokenPri
20
20
  balanceInUsdNumber: number;
21
21
  };
22
22
  export declare const formatVaultBalance: (balance: bigint | undefined, tokenPrice: bigint | undefined) => Balance;
23
+ export declare const truncateString: (str: string, first?: number, last?: number) => string;
24
+ export declare const formatTokenBalance: ({ balance, symbol, precision, truncateSymbol, }: {
25
+ balance: string;
26
+ symbol: string;
27
+ precision: number;
28
+ truncateSymbol?: boolean | undefined;
29
+ }) => string;
@@ -6,3 +6,4 @@ export declare const getNativeTokenInvestableBalance: ({ nativeTokenBalance, tok
6
6
  gasPrice: number;
7
7
  tokenDecimals: number;
8
8
  }) => BigNumber;
9
+ export declare const isStableSymbol: (symbol: string) => boolean;