@kodiak-finance/orderly-ui-transfer 2.9.1 → 2.9.2-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -208,11 +208,22 @@ declare const WithdrawFormWidget: FC<WithdrawFormWidgetProps>;
208
208
 
209
209
  declare const DepositAndWithdrawWithDialogId = "DepositAndWithdrawWithDialogId";
210
210
  declare const DepositAndWithdrawWithSheetId = "DepositAndWithdrawWithSheetId";
211
+ interface DepositTabExtension {
212
+ id: string;
213
+ title: string;
214
+ icon: React.ReactNode;
215
+ component: React.ComponentType<{
216
+ close?: () => void;
217
+ }>;
218
+ order?: number;
219
+ }
211
220
  type DepositAndWithdrawProps = {
212
- activeTab?: "deposit" | "withdraw";
221
+ activeTab?: string;
213
222
  close?: () => void;
223
+ extraTabs?: DepositTabExtension[];
214
224
  };
215
225
  declare const DepositAndWithdraw: FC<DepositAndWithdrawProps>;
226
+ declare const InjectableDepositAndWithdraw: react.ComponentType<DepositAndWithdrawProps>;
216
227
 
217
228
  type TransferFormScriptReturn = ReturnType<typeof useTransferFormScript>;
218
229
  type TransferFormScriptOptions = {
@@ -314,6 +325,7 @@ declare const useConvertFormScript: (options: ConvertFormScriptOptions) => {
314
325
  chain_id?: string | undefined;
315
326
  contract_address?: string | undefined;
316
327
  decimals?: number | undefined;
328
+ exclusive_deposit_supported?: boolean;
317
329
  withdrawal_fee?: number | undefined;
318
330
  chain_name?: string;
319
331
  cross_chain_withdrawal_fee?: number | undefined;
@@ -519,4 +531,4 @@ declare const DepositStatus: react__default.FC<DepositStatusProps>;
519
531
  type DepositStatusWidgetProps = Pick<DepositStatusProps, "className" | "onClick">;
520
532
  declare const DepositStatusWidget: react__default.FC<DepositStatusWidgetProps>;
521
533
 
522
- export { ActionButton, AvailableQuantity, BrokerWallet, ChainSelect, type ConvertFormProps, ConvertFormUI, ConvertFormWidget, type CurrentChain, DEPOSIT_ERROR_CODE_MAP, DepositAction, DepositAndWithdraw, type DepositAndWithdrawProps, DepositAndWithdrawWithDialogId, DepositAndWithdrawWithSheetId, DepositForm, type DepositFormScriptOptions, DepositFormWidget, type DepositFormWidgetProps, DepositStatus, DepositStatusWidget, ExchangeDivider, Fee, type InputStatus, QuantityInput, SwapCoin, TransferDialogId, TransferForm, TransferFormWidget, type TransferFormWidgetProps, TransferSheetId, TransferWidget, Web3Wallet, WithdrawForm, type WithdrawFormScriptOptions, WithdrawFormWidget, type WithdrawFormWidgetProps, WithdrawTo, YIELD_BEARING_ASSETS, type YieldBearingAsset, YieldBearingReminder, checkIsAccountId, feeDecimalsOffset, getDepositKnownErrorMessage, getTransferErrorMessage, getUSDCToken, getYieldBearingAsset, isYieldBearingAsset, sortTokensWithUSDCFirst, useConvertFormScript as useConvertForm, useDepositFormScript, useDepositStatusScript, useTransferFormScript, useWithdrawFormScript };
534
+ export { ActionButton, AvailableQuantity, BrokerWallet, ChainSelect, type ConvertFormProps, ConvertFormUI, ConvertFormWidget, type CurrentChain, DEPOSIT_ERROR_CODE_MAP, DepositAction, DepositAndWithdraw, type DepositAndWithdrawProps, DepositAndWithdrawWithDialogId, DepositAndWithdrawWithSheetId, DepositForm, type DepositFormScriptOptions, DepositFormWidget, type DepositFormWidgetProps, DepositStatus, DepositStatusWidget, type DepositTabExtension, ExchangeDivider, Fee, InjectableDepositAndWithdraw, type InputStatus, QuantityInput, SwapCoin, TransferDialogId, TransferForm, TransferFormWidget, type TransferFormWidgetProps, TransferSheetId, TransferWidget, Web3Wallet, WithdrawForm, type WithdrawFormScriptOptions, WithdrawFormWidget, type WithdrawFormWidgetProps, WithdrawTo, YIELD_BEARING_ASSETS, type YieldBearingAsset, YieldBearingReminder, checkIsAccountId, feeDecimalsOffset, getDepositKnownErrorMessage, getTransferErrorMessage, getUSDCToken, getYieldBearingAsset, isYieldBearingAsset, sortTokensWithUSDCFirst, useConvertFormScript as useConvertForm, useDepositFormScript, useDepositStatusScript, useTransferFormScript, useWithdrawFormScript };
package/dist/index.d.ts CHANGED
@@ -208,11 +208,22 @@ declare const WithdrawFormWidget: FC<WithdrawFormWidgetProps>;
208
208
 
209
209
  declare const DepositAndWithdrawWithDialogId = "DepositAndWithdrawWithDialogId";
210
210
  declare const DepositAndWithdrawWithSheetId = "DepositAndWithdrawWithSheetId";
211
+ interface DepositTabExtension {
212
+ id: string;
213
+ title: string;
214
+ icon: React.ReactNode;
215
+ component: React.ComponentType<{
216
+ close?: () => void;
217
+ }>;
218
+ order?: number;
219
+ }
211
220
  type DepositAndWithdrawProps = {
212
- activeTab?: "deposit" | "withdraw";
221
+ activeTab?: string;
213
222
  close?: () => void;
223
+ extraTabs?: DepositTabExtension[];
214
224
  };
215
225
  declare const DepositAndWithdraw: FC<DepositAndWithdrawProps>;
226
+ declare const InjectableDepositAndWithdraw: react.ComponentType<DepositAndWithdrawProps>;
216
227
 
217
228
  type TransferFormScriptReturn = ReturnType<typeof useTransferFormScript>;
218
229
  type TransferFormScriptOptions = {
@@ -314,6 +325,7 @@ declare const useConvertFormScript: (options: ConvertFormScriptOptions) => {
314
325
  chain_id?: string | undefined;
315
326
  contract_address?: string | undefined;
316
327
  decimals?: number | undefined;
328
+ exclusive_deposit_supported?: boolean;
317
329
  withdrawal_fee?: number | undefined;
318
330
  chain_name?: string;
319
331
  cross_chain_withdrawal_fee?: number | undefined;
@@ -519,4 +531,4 @@ declare const DepositStatus: react__default.FC<DepositStatusProps>;
519
531
  type DepositStatusWidgetProps = Pick<DepositStatusProps, "className" | "onClick">;
520
532
  declare const DepositStatusWidget: react__default.FC<DepositStatusWidgetProps>;
521
533
 
522
- export { ActionButton, AvailableQuantity, BrokerWallet, ChainSelect, type ConvertFormProps, ConvertFormUI, ConvertFormWidget, type CurrentChain, DEPOSIT_ERROR_CODE_MAP, DepositAction, DepositAndWithdraw, type DepositAndWithdrawProps, DepositAndWithdrawWithDialogId, DepositAndWithdrawWithSheetId, DepositForm, type DepositFormScriptOptions, DepositFormWidget, type DepositFormWidgetProps, DepositStatus, DepositStatusWidget, ExchangeDivider, Fee, type InputStatus, QuantityInput, SwapCoin, TransferDialogId, TransferForm, TransferFormWidget, type TransferFormWidgetProps, TransferSheetId, TransferWidget, Web3Wallet, WithdrawForm, type WithdrawFormScriptOptions, WithdrawFormWidget, type WithdrawFormWidgetProps, WithdrawTo, YIELD_BEARING_ASSETS, type YieldBearingAsset, YieldBearingReminder, checkIsAccountId, feeDecimalsOffset, getDepositKnownErrorMessage, getTransferErrorMessage, getUSDCToken, getYieldBearingAsset, isYieldBearingAsset, sortTokensWithUSDCFirst, useConvertFormScript as useConvertForm, useDepositFormScript, useDepositStatusScript, useTransferFormScript, useWithdrawFormScript };
534
+ export { ActionButton, AvailableQuantity, BrokerWallet, ChainSelect, type ConvertFormProps, ConvertFormUI, ConvertFormWidget, type CurrentChain, DEPOSIT_ERROR_CODE_MAP, DepositAction, DepositAndWithdraw, type DepositAndWithdrawProps, DepositAndWithdrawWithDialogId, DepositAndWithdrawWithSheetId, DepositForm, type DepositFormScriptOptions, DepositFormWidget, type DepositFormWidgetProps, DepositStatus, DepositStatusWidget, type DepositTabExtension, ExchangeDivider, Fee, InjectableDepositAndWithdraw, type InputStatus, QuantityInput, SwapCoin, TransferDialogId, TransferForm, TransferFormWidget, type TransferFormWidgetProps, TransferSheetId, TransferWidget, Web3Wallet, WithdrawForm, type WithdrawFormScriptOptions, WithdrawFormWidget, type WithdrawFormWidgetProps, WithdrawTo, YIELD_BEARING_ASSETS, type YieldBearingAsset, YieldBearingReminder, checkIsAccountId, feeDecimalsOffset, getDepositKnownErrorMessage, getTransferErrorMessage, getUSDCToken, getYieldBearingAsset, isYieldBearingAsset, sortTokensWithUSDCFirst, useConvertFormScript as useConvertForm, useDepositFormScript, useDepositStatusScript, useTransferFormScript, useWithdrawFormScript };
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ var orderlyCore = require('@kodiak-finance/orderly-core');
14
14
  var orderlyUiChainSelector = require('@kodiak-finance/orderly-ui-chain-selector');
15
15
  var web3_js = require('@solana/web3.js');
16
16
  var ethers = require('ethers');
17
+ var orderlyPluginCore = require('@kodiak-finance/orderly-plugin-core');
17
18
  var orderlyDefaultSolanaAdapter = require('@kodiak-finance/orderly-default-solana-adapter');
18
19
 
19
20
  // src/components/depositForm/depositForm.ui.tsx
@@ -6003,10 +6004,14 @@ var WithdrawSlot = (props) => {
6003
6004
  var DepositAndWithdrawWithDialogId = "DepositAndWithdrawWithDialogId";
6004
6005
  var DepositAndWithdrawWithSheetId = "DepositAndWithdrawWithSheetId";
6005
6006
  var DepositAndWithdraw = (props) => {
6007
+ const { extraTabs = [] } = props;
6006
6008
  const [activeTab, setActiveTab] = react.useState(
6007
6009
  props.activeTab || "deposit"
6008
6010
  );
6009
6011
  const { t } = orderlyI18n.useTranslation();
6012
+ const sortedExtra = [...extraTabs].sort(
6013
+ (a, b) => (a.order ?? 100) - (b.order ?? 100)
6014
+ );
6010
6015
  return /* @__PURE__ */ jsxRuntime.jsxs(
6011
6016
  orderlyUi.Tabs,
6012
6017
  {
@@ -6036,18 +6041,39 @@ var DepositAndWithdraw = (props) => {
6036
6041
  value: "withdraw",
6037
6042
  children: /* @__PURE__ */ jsxRuntime.jsx(WithdrawSlot, { close: props.close })
6038
6043
  }
6039
- )
6044
+ ),
6045
+ sortedExtra.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(
6046
+ orderlyUi.TabPanel,
6047
+ {
6048
+ title: tab.title,
6049
+ icon: react.isValidElement(tab.icon) ? tab.icon : void 0,
6050
+ value: tab.id,
6051
+ children: /* @__PURE__ */ jsxRuntime.jsx(tab.component, { close: props.close })
6052
+ },
6053
+ tab.id
6054
+ ))
6040
6055
  ]
6041
6056
  }
6042
6057
  );
6043
6058
  };
6044
- orderlyUi.registerSimpleDialog(DepositAndWithdrawWithDialogId, DepositAndWithdraw, {
6045
- size: "md",
6046
- classNames: {
6047
- content: "oui-border oui-border-line-6"
6059
+ var InjectableDepositAndWithdraw = orderlyPluginCore.injectable(
6060
+ DepositAndWithdraw,
6061
+ "Transfer.DepositAndWithdraw"
6062
+ );
6063
+ orderlyUi.registerSimpleDialog(
6064
+ DepositAndWithdrawWithDialogId,
6065
+ InjectableDepositAndWithdraw,
6066
+ {
6067
+ size: "md",
6068
+ classNames: {
6069
+ content: "oui-border oui-border-line-6"
6070
+ }
6048
6071
  }
6049
- });
6050
- orderlyUi.registerSimpleSheet(DepositAndWithdrawWithSheetId, DepositAndWithdraw);
6072
+ );
6073
+ orderlyUi.registerSimpleSheet(
6074
+ DepositAndWithdrawWithSheetId,
6075
+ InjectableDepositAndWithdraw
6076
+ );
6051
6077
  var AccountSelect = (props) => {
6052
6078
  const { subAccounts = [], value } = props;
6053
6079
  const [open, setOpen] = react.useState(false);
@@ -7904,6 +7930,7 @@ exports.DepositStatus = DepositStatus;
7904
7930
  exports.DepositStatusWidget = DepositStatusWidget;
7905
7931
  exports.ExchangeDivider = ExchangeDivider;
7906
7932
  exports.Fee = Fee;
7933
+ exports.InjectableDepositAndWithdraw = InjectableDepositAndWithdraw;
7907
7934
  exports.QuantityInput = QuantityInput;
7908
7935
  exports.SwapCoin = SwapCoin;
7909
7936
  exports.TransferDialogId = TransferDialogId;