@rango-dev/widget-embedded 0.32.1 → 0.32.2-next.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.
Files changed (130) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  3. package/dist/components/Slippage/Slippage.d.ts.map +1 -1
  4. package/dist/components/StatefulConnectModal/StatefulConnectModal.d.ts +11 -0
  5. package/dist/components/StatefulConnectModal/StatefulConnectModal.d.ts.map +1 -0
  6. package/dist/components/StatefulConnectModal/helpers.d.ts +10 -0
  7. package/dist/components/StatefulConnectModal/helpers.d.ts.map +1 -0
  8. package/dist/components/StatefulConnectModal/index.d.ts +2 -0
  9. package/dist/components/StatefulConnectModal/index.d.ts.map +1 -0
  10. package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
  11. package/dist/components/WalletStatefulConnect/ConnectStatus.d.ts +4 -0
  12. package/dist/components/WalletStatefulConnect/ConnectStatus.d.ts.map +1 -0
  13. package/dist/components/{WalletModal/WalletModalContent.styles.d.ts → WalletStatefulConnect/ConnectStatus.styles.d.ts} +1 -1
  14. package/dist/components/{WalletModal/WalletModalContent.styles.d.ts.map → WalletStatefulConnect/ConnectStatus.styles.d.ts.map} +1 -1
  15. package/dist/components/WalletStatefulConnect/ConnectStatus.types.d.ts +8 -0
  16. package/dist/components/WalletStatefulConnect/ConnectStatus.types.d.ts.map +1 -0
  17. package/dist/components/WalletStatefulConnect/DerivationPath.d.ts +4 -0
  18. package/dist/components/WalletStatefulConnect/DerivationPath.d.ts.map +1 -0
  19. package/dist/components/WalletStatefulConnect/DerivationPath.helpers.d.ts +4 -0
  20. package/dist/components/WalletStatefulConnect/DerivationPath.helpers.d.ts.map +1 -0
  21. package/dist/components/{WalletDerivationPathModal/WalletDerivationPathModal.styles.d.ts → WalletStatefulConnect/DerivationPath.styles.d.ts} +1 -1
  22. package/dist/components/WalletStatefulConnect/DerivationPath.styles.d.ts.map +1 -0
  23. package/dist/components/WalletStatefulConnect/DerivationPath.types.d.ts +6 -0
  24. package/dist/components/WalletStatefulConnect/DerivationPath.types.d.ts.map +1 -0
  25. package/dist/components/WalletStatefulConnect/ExperimentalChain.d.ts +8 -0
  26. package/dist/components/WalletStatefulConnect/ExperimentalChain.d.ts.map +1 -0
  27. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.d.ts +4 -0
  28. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.d.ts.map +1 -0
  29. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.helpers.d.ts +8 -0
  30. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.helpers.d.ts.map +1 -0
  31. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.types.d.ts +6 -0
  32. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.types.d.ts.map +1 -0
  33. package/dist/components/WalletStatefulConnect/Namespaces.d.ts +4 -0
  34. package/dist/components/WalletStatefulConnect/Namespaces.d.ts.map +1 -0
  35. package/dist/components/WalletStatefulConnect/Namespaces.helpers.d.ts +3 -0
  36. package/dist/components/WalletStatefulConnect/Namespaces.helpers.d.ts.map +1 -0
  37. package/dist/components/{WalletNamespacesModal/WalletNamespacesModal.styles.d.ts → WalletStatefulConnect/Namespaces.styles.d.ts} +1 -1
  38. package/dist/components/WalletStatefulConnect/Namespaces.styles.d.ts.map +1 -0
  39. package/dist/components/WalletStatefulConnect/Namespaces.types.d.ts +7 -0
  40. package/dist/components/WalletStatefulConnect/Namespaces.types.d.ts.map +1 -0
  41. package/dist/components/WalletStatefulConnect/index.d.ts +5 -0
  42. package/dist/components/WalletStatefulConnect/index.d.ts.map +1 -0
  43. package/dist/containers/Wallets/Wallets.types.d.ts +1 -1
  44. package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -1
  45. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +1 -1
  46. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -1
  47. package/dist/hooks/useStatefulConnect/index.d.ts +5 -0
  48. package/dist/hooks/useStatefulConnect/index.d.ts.map +1 -0
  49. package/dist/hooks/useStatefulConnect/useStatefulConnect.d.ts +25 -0
  50. package/dist/hooks/useStatefulConnect/useStatefulConnect.d.ts.map +1 -0
  51. package/dist/hooks/useStatefulConnect/useStatefulConnect.helpers.d.ts +8 -0
  52. package/dist/hooks/useStatefulConnect/useStatefulConnect.helpers.d.ts.map +1 -0
  53. package/dist/hooks/useStatefulConnect/useStatefulConnect.state.d.ts +9 -0
  54. package/dist/hooks/useStatefulConnect/useStatefulConnect.state.d.ts.map +1 -0
  55. package/dist/hooks/useStatefulConnect/useStatefulConnect.types.d.ts +43 -0
  56. package/dist/hooks/useStatefulConnect/useStatefulConnect.types.d.ts.map +1 -0
  57. package/dist/hooks/useWalletList.d.ts +11 -14
  58. package/dist/hooks/useWalletList.d.ts.map +1 -1
  59. package/dist/index.d.ts +5 -3
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +2 -2
  62. package/dist/index.js.map +4 -4
  63. package/dist/pages/WalletsPage.d.ts +0 -2
  64. package/dist/pages/WalletsPage.d.ts.map +1 -1
  65. package/dist/widget-embedded.build.json +1 -1
  66. package/package.json +9 -8
  67. package/src/components/ConfirmWalletsModal/WalletList.tsx +52 -243
  68. package/src/components/HeaderButtons/WalletButton.tsx +1 -1
  69. package/src/components/Slippage/Slippage.tsx +3 -0
  70. package/src/components/StatefulConnectModal/StatefulConnectModal.tsx +168 -0
  71. package/src/components/StatefulConnectModal/helpers.ts +23 -0
  72. package/src/components/StatefulConnectModal/index.ts +1 -0
  73. package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +23 -113
  74. package/src/components/{WalletModal/WalletModalContent.tsx → WalletStatefulConnect/ConnectStatus.tsx} +13 -5
  75. package/src/components/WalletStatefulConnect/ConnectStatus.types.ts +11 -0
  76. package/src/components/WalletStatefulConnect/DerivationPath.helpers.ts +23 -0
  77. package/src/components/{WalletDerivationPathModal/WalletDerivationPathModal.tsx → WalletStatefulConnect/DerivationPath.tsx} +18 -36
  78. package/src/components/WalletStatefulConnect/DerivationPath.types.ts +6 -0
  79. package/src/components/WalletStatefulConnect/ExperimentalChain.tsx +36 -0
  80. package/src/components/WalletStatefulConnect/ExperimentalChainStatus.helpers.ts +53 -0
  81. package/src/components/WalletStatefulConnect/ExperimentalChainStatus.tsx +35 -0
  82. package/src/components/WalletStatefulConnect/ExperimentalChainStatus.types.ts +5 -0
  83. package/src/components/WalletStatefulConnect/Namespaces.helpers.ts +9 -0
  84. package/src/components/{WalletNamespacesModal/WalletNamespacesModal.tsx → WalletStatefulConnect/Namespaces.tsx} +9 -27
  85. package/src/components/{WalletNamespacesModal/WalletNamespacesModal.types.tsx → WalletStatefulConnect/Namespaces.types.tsx} +2 -5
  86. package/src/components/WalletStatefulConnect/index.ts +4 -0
  87. package/src/containers/Wallets/Wallets.tsx +1 -1
  88. package/src/containers/Wallets/Wallets.types.ts +1 -1
  89. package/src/containers/WidgetProvider/WidgetProvider.types.ts +1 -1
  90. package/src/hooks/useStatefulConnect/index.ts +9 -0
  91. package/src/hooks/useStatefulConnect/useStatefulConnect.helpers.ts +13 -0
  92. package/src/hooks/useStatefulConnect/useStatefulConnect.state.ts +45 -0
  93. package/src/hooks/useStatefulConnect/useStatefulConnect.ts +232 -0
  94. package/src/hooks/useStatefulConnect/useStatefulConnect.types.ts +56 -0
  95. package/src/hooks/useWalletList.ts +22 -53
  96. package/src/index.ts +7 -8
  97. package/src/pages/WalletsPage.tsx +10 -162
  98. package/src/store/wallets.ts +1 -1
  99. package/src/utils/wallets.ts +1 -1
  100. package/dist/components/WalletDerivationPathModal/WalletDerivationPathModal.d.ts +0 -4
  101. package/dist/components/WalletDerivationPathModal/WalletDerivationPathModal.d.ts.map +0 -1
  102. package/dist/components/WalletDerivationPathModal/WalletDerivationPathModal.styles.d.ts.map +0 -1
  103. package/dist/components/WalletDerivationPathModal/WalletDerivationPathModal.types.d.ts +0 -10
  104. package/dist/components/WalletDerivationPathModal/WalletDerivationPathModal.types.d.ts.map +0 -1
  105. package/dist/components/WalletDerivationPathModal/index.d.ts +0 -2
  106. package/dist/components/WalletDerivationPathModal/index.d.ts.map +0 -1
  107. package/dist/components/WalletModal/WalletModal.d.ts +0 -4
  108. package/dist/components/WalletModal/WalletModal.d.ts.map +0 -1
  109. package/dist/components/WalletModal/WalletModal.types.d.ts +0 -10
  110. package/dist/components/WalletModal/WalletModal.types.d.ts.map +0 -1
  111. package/dist/components/WalletModal/WalletModalContent.d.ts +0 -4
  112. package/dist/components/WalletModal/WalletModalContent.d.ts.map +0 -1
  113. package/dist/components/WalletModal/index.d.ts +0 -2
  114. package/dist/components/WalletModal/index.d.ts.map +0 -1
  115. package/dist/components/WalletNamespacesModal/WalletNamespacesModal.d.ts +0 -4
  116. package/dist/components/WalletNamespacesModal/WalletNamespacesModal.d.ts.map +0 -1
  117. package/dist/components/WalletNamespacesModal/WalletNamespacesModal.styles.d.ts.map +0 -1
  118. package/dist/components/WalletNamespacesModal/WalletNamespacesModal.types.d.ts +0 -10
  119. package/dist/components/WalletNamespacesModal/WalletNamespacesModal.types.d.ts.map +0 -1
  120. package/dist/components/WalletNamespacesModal/index.d.ts +0 -2
  121. package/dist/components/WalletNamespacesModal/index.d.ts.map +0 -1
  122. package/src/components/WalletDerivationPathModal/WalletDerivationPathModal.types.tsx +0 -10
  123. package/src/components/WalletDerivationPathModal/index.ts +0 -1
  124. package/src/components/WalletModal/WalletModal.tsx +0 -25
  125. package/src/components/WalletModal/WalletModal.types.ts +0 -11
  126. package/src/components/WalletModal/index.ts +0 -1
  127. package/src/components/WalletNamespacesModal/index.ts +0 -1
  128. /package/src/components/{WalletModal/WalletModalContent.styles.ts → WalletStatefulConnect/ConnectStatus.styles.ts} +0 -0
  129. /package/src/components/{WalletDerivationPathModal/WalletDerivationPathModal.styles.ts → WalletStatefulConnect/DerivationPath.styles.ts} +0 -0
  130. /package/src/components/{WalletNamespacesModal/WalletNamespacesModal.styles.ts → WalletStatefulConnect/Namespaces.styles.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.32.1](https://github.com/rango-exchange/rango-client/compare/widget-embedded@0.32.0...widget-embedded@0.32.1) (2024-08-17)
2
+
3
+
4
+
1
5
  # [0.32.0](https://github.com/rango-exchange/rango-client/compare/widget-embedded@0.31.0...widget-embedded@0.32.0) (2024-08-17)
2
6
 
3
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"WalletList.d.ts","sourceRoot":"","sources":["../../../src/components/ConfirmWalletsModal/WalletList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcnD,OAAO,KAA8B,MAAM,OAAO,CAAC;AA8CnD,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,qBA+X1C"}
1
+ {"version":3,"file":"WalletList.d.ts","sourceRoot":"","sources":["../../../src/components/ConfirmWalletsModal/WalletList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAWnD,OAAO,KAA8B,MAAM,OAAO,CAAC;AA4BnD,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,qBAqN1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"Slippage.d.ts","sourceRoot":"","sources":["../../../src/components/Slippage/Slippage.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,wBAAgB,QAAQ,sBAkEvB"}
1
+ {"version":3,"file":"Slippage.d.ts","sourceRoot":"","sources":["../../../src/components/Slippage/Slippage.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,wBAAgB,QAAQ,sBAoEvB"}
@@ -0,0 +1,11 @@
1
+ import type { Result } from '../../hooks/useStatefulConnect';
2
+ import type { WalletInfoWithExtra } from '../../types';
3
+ import React from 'react';
4
+ interface PropTypes {
5
+ wallet: WalletInfoWithExtra | undefined;
6
+ onClose: () => void;
7
+ onConnect?: (result: Result) => void;
8
+ }
9
+ export declare function StatefulConnectModal(props: PropTypes): React.JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=StatefulConnectModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatefulConnectModal.d.ts","sourceRoot":"","sources":["../../../src/components/StatefulConnectModal/StatefulConnectModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIvD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAoBnD,UAAU,SAAS;IACjB,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACxC,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,qBAuIpD"}
@@ -0,0 +1,10 @@
1
+ import type { State } from '../../hooks/useStatefulConnect';
2
+ import type { WalletInfoWithExtra } from '../../types';
3
+ export declare function isOnStatus(getState: () => State, wallet?: WalletInfoWithExtra): wallet is WalletInfoWithExtra;
4
+ export declare function isOnNamespace(getState: () => State): getState is () => State & {
5
+ namespace: NonNullable<State['namespace']>;
6
+ };
7
+ export declare function isOnDerivationPath(getState: () => State): getState is () => State & {
8
+ derivationPath: NonNullable<State['derivationPath']>;
9
+ };
10
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/components/StatefulConnectModal/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,wBAAgB,UAAU,CACxB,QAAQ,EAAE,MAAM,KAAK,EACrB,MAAM,CAAC,EAAE,mBAAmB,GAC3B,MAAM,IAAI,mBAAmB,CAE/B;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,KAAK,GACpB,QAAQ,IAAI,MAAM,KAAK,GAAG;IAAE,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;CAAE,CAE1E;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,KAAK,GACpB,QAAQ,IAAI,MAAM,KAAK,GAAG;IAC3B,cAAc,EAAE,WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;CACtD,CAEA"}
@@ -0,0 +1,2 @@
1
+ export { StatefulConnectModal } from './StatefulConnectModal';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StatefulConnectModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SwapDetailsModal.WalletState.d.ts","sourceRoot":"","sources":["../../../src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAMxE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAwBxC,eAAO,MAAM,kBAAkB,UAAW,uBAAuB,sBA0IhE,CAAC"}
1
+ {"version":3,"file":"SwapDetailsModal.WalletState.d.ts","sourceRoot":"","sources":["../../../src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAMxE,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,eAAO,MAAM,kBAAkB,UAAW,uBAAuB,sBA+DhE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ConnectStatusProps } from './ConnectStatus.types';
2
+ import React from 'react';
3
+ export declare function ConnectStatus(props: ConnectStatusProps): React.JSX.Element;
4
+ //# sourceMappingURL=ConnectStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectStatus.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/ConnectStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAKhE,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBA8CtD"}
@@ -638,4 +638,4 @@ export declare const WalletImageContainer: import("@stitches/react/types/styled-
638
638
  zIndices: {};
639
639
  transitions: {};
640
640
  }, import("@stitches/react/types/config").DefaultThemeMap, {}>>;
641
- //# sourceMappingURL=WalletModalContent.styles.d.ts.map
641
+ //# sourceMappingURL=ConnectStatus.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WalletModalContent.styles.d.ts","sourceRoot":"","sources":["../../../src/components/WalletModal/WalletModalContent.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAQxB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAExB,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;;;;;;;;;+DAYlB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAI/B,CAAC"}
@@ -0,0 +1,8 @@
1
+ export interface ConnectStatusProps {
2
+ wallet: {
3
+ type: string;
4
+ image: string;
5
+ };
6
+ error?: string;
7
+ }
8
+ //# sourceMappingURL=ConnectStatus.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectStatus.types.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/ConnectStatus.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAKjC,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,4 @@
1
+ import type { PropTypes } from './DerivationPath.types';
2
+ import React from 'react';
3
+ export declare function DerivationPath(props: PropTypes): React.JSX.Element;
4
+ //# sourceMappingURL=DerivationPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DerivationPath.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/DerivationPath.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAYxD,OAAO,KAA8B,MAAM,OAAO,CAAC;AAiBnD,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,qBA0G9C"}
@@ -0,0 +1,4 @@
1
+ import type { DerivationPath, Namespace } from '@rango-dev/wallets-shared';
2
+ export declare const CUSTOM_DERIVATION_PATH: DerivationPath;
3
+ export declare function getDerivationPaths(selectedNamespace?: Namespace): DerivationPath[];
4
+ //# sourceMappingURL=DerivationPath.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DerivationPath.helpers.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/DerivationPath.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3E,eAAO,MAAM,sBAAsB,EAAE,cAIpC,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,iBAAiB,CAAC,EAAE,SAAS,GAC5B,cAAc,EAAE,CAUlB"}
@@ -324,4 +324,4 @@ export declare const derivationPathInputStyles: {
324
324
  backgroundColor: string;
325
325
  borderRadius: string;
326
326
  };
327
- //# sourceMappingURL=WalletDerivationPathModal.styles.d.ts.map
327
+ //# sourceMappingURL=DerivationPath.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DerivationPath.styles.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/DerivationPath.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,UAAU,EAAE,MAAM,eAAe,CAAC;AAEnD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAI1B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAErB,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;CAIrC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { NeedsDerivationPathState } from '../../hooks/useStatefulConnect';
2
+ export interface PropTypes {
3
+ value: NeedsDerivationPathState;
4
+ onConfirm: (path: string) => void;
5
+ }
6
+ //# sourceMappingURL=DerivationPath.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DerivationPath.types.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/DerivationPath.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE/E,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,wBAAwB,CAAC;IAChC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC"}
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface PropTypes {
3
+ displayName?: string;
4
+ onConfirm: () => void;
5
+ }
6
+ export declare function ExperimentalChain(props: PropTypes): React.JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=ExperimentalChain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExperimentalChain.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/ExperimentalChain.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,SAAS;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,qBA0BjD"}
@@ -0,0 +1,4 @@
1
+ import type { PropTypes } from './ExperimentalChainStatus.types';
2
+ import React from 'react';
3
+ export declare function ExperimentalChainStatus(props: PropTypes): React.JSX.Element;
4
+ //# sourceMappingURL=ExperimentalChainStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExperimentalChainStatus.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/ExperimentalChainStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS,qBAsBvD"}
@@ -0,0 +1,8 @@
1
+ import type { PropTypes } from './ExperimentalChainStatus.types';
2
+ import type { MessageType } from '@rango-dev/ui';
3
+ export declare function generateMessageByStatus(status: PropTypes['status'], blockchainDisplayName: string | undefined): {
4
+ type: MessageType;
5
+ title: string;
6
+ description: string;
7
+ };
8
+ //# sourceMappingURL=ExperimentalChainStatus.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExperimentalChainStatus.helpers.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/ExperimentalChainStatus.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,EAC3B,qBAAqB,EAAE,MAAM,GAAG,SAAS,GACxC;IACD,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAwCA"}
@@ -0,0 +1,6 @@
1
+ export interface PropTypes {
2
+ displayName?: string;
3
+ status: 'in-progress' | 'completed' | 'rejected';
4
+ image: string;
5
+ }
6
+ //# sourceMappingURL=ExperimentalChainStatus.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExperimentalChainStatus.types.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/ExperimentalChainStatus.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC;IACjD,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,4 @@
1
+ import type { PropTypes } from './Namespaces.types';
2
+ import React from 'react';
3
+ export declare function Namespaces(props: PropTypes): React.JSX.Element;
4
+ //# sourceMappingURL=Namespaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Namespaces.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/Namespaces.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAepD,OAAO,KAA4B,MAAM,OAAO,CAAC;AASjD,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,qBA8F1C"}
@@ -0,0 +1,3 @@
1
+ import type { BlockchainMeta } from 'rango-types';
2
+ export declare function getBlockchainLogo(blockchains: BlockchainMeta[], blockchainName: string): string | undefined;
3
+ //# sourceMappingURL=Namespaces.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Namespaces.helpers.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/Namespaces.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,cAAc,EAAE,EAC7B,cAAc,EAAE,MAAM,sBAIvB"}
@@ -158,4 +158,4 @@ export declare const NamespaceList: import("@stitches/react/types/styled-compone
158
158
  zIndices: {};
159
159
  transitions: {};
160
160
  }, import("@stitches/react/types/config").DefaultThemeMap, {}>>;
161
- //# sourceMappingURL=WalletNamespacesModal.styles.d.ts.map
161
+ //# sourceMappingURL=Namespaces.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Namespaces.styles.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/Namespaces.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAIxB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { NeedsNamespacesState } from '../../hooks/useStatefulConnect';
2
+ import type { Namespace } from '@rango-dev/wallets-shared';
3
+ export interface PropTypes {
4
+ onConfirm: (namespaces: Namespace[]) => void;
5
+ value: NeedsNamespacesState;
6
+ }
7
+ //# sourceMappingURL=Namespaces.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Namespaces.types.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/Namespaces.types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAC7C,KAAK,EAAE,oBAAoB,CAAC;CAC7B"}
@@ -0,0 +1,5 @@
1
+ export { Namespaces } from './Namespaces';
2
+ export { DerivationPath } from './DerivationPath';
3
+ export { ConnectStatus } from './ConnectStatus';
4
+ export { ExperimentalChain } from './ExperimentalChain';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/WalletStatefulConnect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { WidgetConfig } from '../../types';
2
- import type { EventHandler } from '@rango-dev/wallets-react';
2
+ import type { LegacyEventHandler as EventHandler } from '@rango-dev/wallets-core/legacy';
3
3
  export type OnWalletConnectionChange = (key: string) => void;
4
4
  export interface WidgetContextInterface {
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Wallets.types.d.ts","sourceRoot":"","sources":["../../../src/containers/Wallets/Wallets.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,MAAM,wBAAwB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAC7D,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAAC;IACzD;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAC7D;AAED,MAAM,WAAW,SAAS;IACxB,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,MAAM,EAAE,YAAY,CAAC;CACtB"}
1
+ {"version":3,"file":"Wallets.types.d.ts","sourceRoot":"","sources":["../../../src/containers/Wallets/Wallets.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEzF,MAAM,MAAM,wBAAwB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAC7D,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAAC;IACzD;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAC7D;AAED,MAAM,WAAW,SAAS;IACxB,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,MAAM,EAAE,YAAY,CAAC;CACtB"}
@@ -1,5 +1,5 @@
1
1
  import type { WidgetConfig } from '../../types';
2
- import type { EventHandler } from '@rango-dev/wallets-react';
2
+ import type { LegacyEventHandler as EventHandler } from '@rango-dev/wallets-core/legacy';
3
3
  export type PropTypes = {
4
4
  onUpdateState?: EventHandler;
5
5
  config: WidgetConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"WidgetProvider.types.d.ts","sourceRoot":"","sources":["../../../src/containers/WidgetProvider/WidgetProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,MAAM,SAAS,GAAG;IACtB,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"WidgetProvider.types.d.ts","sourceRoot":"","sources":["../../../src/containers/WidgetProvider/WidgetProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEzF,MAAM,MAAM,SAAS,GAAG;IACtB,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { useStatefulConnect } from './useStatefulConnect';
2
+ export { ResultStatus } from './useStatefulConnect.types';
3
+ export type { NeedsNamespacesState, NeedsDerivationPathState, Result, } from './useStatefulConnect.types';
4
+ export type { State } from './useStatefulConnect.state';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useStatefulConnect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EACV,oBAAoB,EACpB,wBAAwB,EACxB,MAAM,GACP,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { HandleConnectOptions, Result } from './useStatefulConnect.types';
2
+ import type { WalletInfoWithExtra } from '../../types';
3
+ import type { Namespace, WalletType } from '@rango-dev/wallets-shared';
4
+ import { type State } from './useStatefulConnect.state';
5
+ interface UseStatefulConnect {
6
+ handleConnect: (wallet: WalletInfoWithExtra, options?: HandleConnectOptions) => Promise<Result>;
7
+ handleNamespace: (wallet: WalletInfoWithExtra, selectedNamespaces: Namespace[]) => Promise<Result>;
8
+ handleDerivationPath: (path: string) => Promise<Result>;
9
+ handleDisconnect: (type: WalletType) => Promise<Result>;
10
+ getState(): State;
11
+ resetState(section?: 'derivation'): void;
12
+ }
13
+ /**
14
+ *
15
+ * This hook maintains state of wallet and checks if additional information
16
+ * is required to call the `connect` method of `core` package properly.
17
+ *
18
+ * The final goal is running `runConnect` which calls `wallets/core`'s `connect` method.
19
+ * But sometimes it needs to get more information like what namespace it should be connected to,
20
+ * or what derivation path should be used for.
21
+ *
22
+ */
23
+ export declare function useStatefulConnect(): UseStatefulConnect;
24
+ export {};
25
+ //# sourceMappingURL=useStatefulConnect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStatefulConnect.d.ts","sourceRoot":"","sources":["../../../src/hooks/useStatefulConnect/useStatefulConnect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EACV,SAAS,EAET,UAAU,EACX,MAAM,2BAA2B,CAAC;AAUnC,OAAO,EAAsB,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAG5E,UAAU,kBAAkB;IAC1B,aAAa,EAAE,CACb,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,oBAAoB,KAC3B,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,eAAe,EAAE,CACf,MAAM,EAAE,mBAAmB,EAC3B,kBAAkB,EAAE,SAAS,EAAE,KAC5B,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,gBAAgB,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,QAAQ,IAAI,KAAK,CAAC;IAClB,UAAU,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CAC1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,IAAI,kBAAkB,CA2LvD"}
@@ -0,0 +1,8 @@
1
+ import type { State } from './useStatefulConnect.state';
2
+ export declare function isStateOnDerivationPathStep(state: State): state is State & {
3
+ derivationPath: NonNullable<State['derivationPath']>;
4
+ };
5
+ export declare function isStateOnNamespace(state: State): state is State & {
6
+ namespace: NonNullable<State['namespace']>;
7
+ };
8
+ //# sourceMappingURL=useStatefulConnect.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStatefulConnect.helpers.d.ts","sourceRoot":"","sources":["../../../src/hooks/useStatefulConnect/useStatefulConnect.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,KAAK,GACX,KAAK,IAAI,KAAK,GAAG;IAAE,cAAc,EAAE,WAAW,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAA;CAAE,CAE3E;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,GACX,KAAK,IAAI,KAAK,GAAG;IAAE,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;CAAE,CAEjE"}
@@ -0,0 +1,9 @@
1
+ import type { Actions, NeedsDerivationPathState, NeedsNamespacesState } from './useStatefulConnect.types';
2
+ export interface State {
3
+ status: 'init' | 'namespace' | 'derivationPath';
4
+ namespace: NeedsNamespacesState | null;
5
+ derivationPath: NeedsDerivationPathState | null;
6
+ }
7
+ export declare const initState: State;
8
+ export declare function reducer(state: State, action: Actions): State;
9
+ //# sourceMappingURL=useStatefulConnect.state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStatefulConnect.state.d.ts","sourceRoot":"","sources":["../../../src/hooks/useStatefulConnect/useStatefulConnect.state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,gBAAgB,CAAC;IAChD,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACvC,cAAc,EAAE,wBAAwB,GAAG,IAAI,CAAC;CACjD;AAED,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC;AAEF,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,CA0B5D"}
@@ -0,0 +1,43 @@
1
+ import type { Namespace } from '@rango-dev/wallets-shared';
2
+ export interface HandleConnectOptions {
3
+ disconnectIfConnected?: boolean;
4
+ }
5
+ export interface NeedsNamespacesState {
6
+ providerType: string;
7
+ providerImage: string;
8
+ availableNamespaces?: Namespace[];
9
+ singleNamespace?: boolean;
10
+ }
11
+ export interface NeedsDerivationPathState {
12
+ providerType: string;
13
+ providerImage: string;
14
+ namespace: Namespace;
15
+ }
16
+ export declare enum ResultStatus {
17
+ Connected = "connected",
18
+ Namespace = "namespace",
19
+ DerivationPath = "derivation-path",
20
+ Disconnected = "disconnected",
21
+ DisconnectedUnhandled = "disconnected-unhandled",
22
+ Noop = "noop"
23
+ }
24
+ export type Result = {
25
+ status: ResultStatus;
26
+ };
27
+ interface UpdateNamespaceAction {
28
+ type: 'needsNamespace';
29
+ payload: NeedsNamespacesState;
30
+ }
31
+ interface UpdateDerivationPathAction {
32
+ type: 'needsDerivationPath';
33
+ payload: NeedsDerivationPathState;
34
+ }
35
+ interface ResetAction {
36
+ type: 'reset';
37
+ }
38
+ interface ResetDerivationAction {
39
+ type: 'resetDerivation';
40
+ }
41
+ export type Actions = ResetAction | ResetDerivationAction | UpdateDerivationPathAction | UpdateNamespaceAction;
42
+ export {};
43
+ //# sourceMappingURL=useStatefulConnect.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStatefulConnect.types.d.ts","sourceRoot":"","sources":["../../../src/hooks/useStatefulConnect/useStatefulConnect.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IAEnC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,SAAS,EAAE,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,oBAAY,YAAY;IACtB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,cAAc,oBAAoB;IAClC,YAAY,iBAAiB;IAC7B,qBAAqB,2BAA2B;IAChD,IAAI,SAAS;CACd;AAED,MAAM,MAAM,MAAM,GAAG;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC;AAI9C,UAAU,qBAAqB;IAC7B,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,oBAAoB,CAAC;CAC/B;AAED,UAAU,0BAA0B;IAClC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,wBAAwB,CAAC;CACnC;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,OAAO,CAAC;CACf;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,MAAM,OAAO,GACf,WAAW,GACX,qBAAqB,GACrB,0BAA0B,GAC1B,qBAAqB,CAAC"}
@@ -1,21 +1,18 @@
1
- import type { NamespaceData, WalletType } from '@rango-dev/wallets-shared';
1
+ import type { WalletInfoWithExtra } from '../types';
2
2
  interface Params {
3
3
  chain?: string;
4
- onBeforeConnect?: (walletType: string) => void;
5
- onConnect?: (walletType: string) => void;
6
- onError?: (error?: string) => void;
4
+ }
5
+ interface API {
6
+ list: WalletInfoWithExtra[];
7
+ terminateConnectingWallets: () => void;
7
8
  }
8
9
  /**
9
- * gets list of wallets with their information and an action for handling click callback fo UI
10
- * we need to share the logic of rendering list of wallets and handle clicking on them in different places
11
- * you can use this list whenever you need to show the list of wallets and needed callbacks
10
+ *
11
+ * Returning list of wallets which has a applied sorting and filtering (some of wallet can be excluded).
12
+ * It can have some functionality on list itself,
13
+ * now it only has a method to disconnect the wallets that has `connecting` status. This is useful for exiting page and terminating wallet connection.
14
+ *
12
15
  */
13
- export declare function useWalletList(params: Params): {
14
- list: import("..").WalletInfoWithExtra[];
15
- error: string;
16
- handleClick: (type: WalletType, namespaces?: NamespaceData[]) => Promise<void>;
17
- disconnectConnectingWallets: () => void;
18
- disconnectWallet: (type: WalletType) => Promise<void>;
19
- };
16
+ export declare function useWalletList(params?: Params): API;
20
17
  export {};
21
18
  //# sourceMappingURL=useWalletList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWalletList.d.ts","sourceRoot":"","sources":["../../src/hooks/useWalletList.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAyB3E,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM;;;wBAyClC,UAAU,eACH,aAAa,EAAE;;6BAiCQ,UAAU;EAqEjD"}
1
+ {"version":3,"file":"useWalletList.d.ts","sourceRoot":"","sources":["../../src/hooks/useWalletList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AA2BpD,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,GAAG;IACX,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,0BAA0B,EAAE,MAAM,IAAI,CAAC;CACxC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,CA4GlD"}
package/dist/index.d.ts CHANGED
@@ -2,11 +2,12 @@ import type { WidgetProps } from './containers/Widget';
2
2
  import type { ConnectedWallet } from './store/wallets';
3
3
  import type { BlockchainAndTokenConfig, QuoteEventData, Tokens, UiEventData, WalletEventData, WalletInfoWithExtra, WidgetColors, WidgetColorsKeys, WidgetConfig, WidgetTheme, WidgetVariant } from './types';
4
4
  import type { PendingSwapWithQueueID, Route, RouteEvent, RouteEventData, RouteExecutionEvents, RouteFailedEvent, RouteStartedEvent, RouteSucceededEvent, Step, StepApprovalTxSucceededEvent, StepCheckStatusEvent, StepEvent, StepEventData, StepFailedEvent, StepOutputRevealedEvent, StepStartedEvent, StepSucceededEvent, StepTxExecutionBlockedEvent, StepTxExecutionUpdatedEvent } from '@rango-dev/queue-manager-rango-preset';
5
- import type { EventHandler as HandleWalletsUpdate, ProviderInterface } from '@rango-dev/wallets-react';
5
+ import type { LegacyEventHandler as HandleWalletsUpdate, LegacyProviderInterface as ProviderInterface } from '@rango-dev/wallets-core/legacy';
6
6
  import type { WalletInfo, WalletState, WalletType } from '@rango-dev/wallets-shared';
7
7
  import type { PendingSwap, PendingSwapStep } from 'rango-types';
8
8
  import { EventSeverity, RouteEventType, StepEventType, StepExecutionBlockedEventStatus, StepExecutionEventStatus } from '@rango-dev/queue-manager-rango-preset';
9
- import { readAccountAddress, useWallets, Events as WalletEvents } from '@rango-dev/wallets-react';
9
+ import { legacyReadAccountAddress as readAccountAddress } from '@rango-dev/wallets-core/legacy';
10
+ import { useWallets, Events as WalletEvents } from '@rango-dev/wallets-react';
10
11
  import { Networks, WalletTypes } from '@rango-dev/wallets-shared';
11
12
  import { PendingSwapNetworkStatus } from 'rango-types';
12
13
  import { WIDGET_UI_ID as UI_ID } from './constants';
@@ -15,6 +16,7 @@ import { WidgetWallets } from './containers/Wallets';
15
16
  import { Widget } from './containers/Widget';
16
17
  import { useWidget } from './containers/WidgetInfo';
17
18
  import { WidgetProvider } from './containers/WidgetProvider';
19
+ import { useStatefulConnect } from './hooks/useStatefulConnect';
18
20
  import { useWalletList } from './hooks/useWalletList';
19
21
  import { useWidgetEvents } from './hooks/useWidgetEvents';
20
22
  import { widgetEventEmitter } from './services/eventEmitter';
@@ -25,7 +27,7 @@ export { Widget,
25
27
  /**
26
28
  * @deprecated Use `WidgetProvider` instead. This component will be removed in future versions.
27
29
  */
28
- WidgetWallets, WidgetProvider, useWidget, useWallets,
30
+ WidgetWallets, WidgetProvider, useWidget, useWallets, useStatefulConnect,
29
31
  /**
30
32
  * @deprecated Use `widgetEventEmitter` instead. This hook will be removed in future versions.
31
33
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACd,MAAM,EACN,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,sBAAsB,EACtB,KAAK,EACL,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,IAAI,EACJ,4BAA4B,EAC5B,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACV,YAAY,IAAI,mBAAmB,EACnC,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,+BAA+B,EAC/B,wBAAwB,EACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,MAAM,IAAI,YAAY,EACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAA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;;GAEG;AACH,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,+BAA+B,EAC/B,KAAK,EACL,eAAe,GAChB,CAAC;AAGF,YAAY,EACV,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,oBAAoB,GACrB,CAAC;AAGF,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,wBAAwB,EACxB,aAAa,GACd,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACd,MAAM,EACN,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,sBAAsB,EACtB,KAAK,EACL,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,IAAI,EACJ,4BAA4B,EAC5B,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACV,kBAAkB,IAAI,mBAAmB,EACzC,uBAAuB,IAAI,iBAAiB,EAC7C,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;A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