@maximedogawa/chia-wallet-connect-react 0.0.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 (146) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +622 -0
  3. package/dist/api.d.ts +62 -0
  4. package/dist/api.d.ts.map +1 -0
  5. package/dist/api.js +170 -0
  6. package/dist/api.js.map +1 -0
  7. package/dist/components/shared/CopyButton.d.ts +11 -0
  8. package/dist/components/shared/CopyButton.d.ts.map +1 -0
  9. package/dist/components/shared/CopyButton.js +122 -0
  10. package/dist/components/shared/CopyButton.js.map +1 -0
  11. package/dist/components/shared/Modal.d.ts +11 -0
  12. package/dist/components/shared/Modal.d.ts.map +1 -0
  13. package/dist/components/shared/Modal.js +18 -0
  14. package/dist/components/shared/Modal.js.map +1 -0
  15. package/dist/components/shared/SafeImage.d.ts +15 -0
  16. package/dist/components/shared/SafeImage.d.ts.map +1 -0
  17. package/dist/components/shared/SafeImage.js +15 -0
  18. package/dist/components/shared/SafeImage.js.map +1 -0
  19. package/dist/components/shared/icons/ChevronUpDownIcon.d.ts +6 -0
  20. package/dist/components/shared/icons/ChevronUpDownIcon.d.ts.map +1 -0
  21. package/dist/components/shared/icons/ChevronUpDownIcon.js +8 -0
  22. package/dist/components/shared/icons/ChevronUpDownIcon.js.map +1 -0
  23. package/dist/components/shared/icons/CrossIcon.d.ts +8 -0
  24. package/dist/components/shared/icons/CrossIcon.d.ts.map +1 -0
  25. package/dist/components/shared/icons/CrossIcon.js +8 -0
  26. package/dist/components/shared/icons/CrossIcon.js.map +1 -0
  27. package/dist/components/shared/icons/PlusIcon.d.ts +6 -0
  28. package/dist/components/shared/icons/PlusIcon.d.ts.map +1 -0
  29. package/dist/components/shared/icons/PlusIcon.js +8 -0
  30. package/dist/components/shared/icons/PlusIcon.js.map +1 -0
  31. package/dist/components/shared/icons/WalletConnectIcon.d.ts +7 -0
  32. package/dist/components/shared/icons/WalletConnectIcon.d.ts.map +1 -0
  33. package/dist/components/shared/icons/WalletConnectIcon.js +17 -0
  34. package/dist/components/shared/icons/WalletConnectIcon.js.map +1 -0
  35. package/dist/components/shared/navbar/Navbar.d.ts +7 -0
  36. package/dist/components/shared/navbar/Navbar.d.ts.map +1 -0
  37. package/dist/components/shared/navbar/Navbar.js +13 -0
  38. package/dist/components/shared/navbar/Navbar.js.map +1 -0
  39. package/dist/components/shared/navbar/walletIntegration/AddAssetButton.d.ts +10 -0
  40. package/dist/components/shared/navbar/walletIntegration/AddAssetButton.d.ts.map +1 -0
  41. package/dist/components/shared/navbar/walletIntegration/AddAssetButton.js +36 -0
  42. package/dist/components/shared/navbar/walletIntegration/AddAssetButton.js.map +1 -0
  43. package/dist/components/shared/navbar/walletIntegration/ConnectButton.d.ts +25 -0
  44. package/dist/components/shared/navbar/walletIntegration/ConnectButton.d.ts.map +1 -0
  45. package/dist/components/shared/navbar/walletIntegration/ConnectButton.js +79 -0
  46. package/dist/components/shared/navbar/walletIntegration/ConnectButton.js.map +1 -0
  47. package/dist/components/shared/navbar/walletIntegration/ConnectWalletModal.d.ts +10 -0
  48. package/dist/components/shared/navbar/walletIntegration/ConnectWalletModal.d.ts.map +1 -0
  49. package/dist/components/shared/navbar/walletIntegration/ConnectWalletModal.js +129 -0
  50. package/dist/components/shared/navbar/walletIntegration/ConnectWalletModal.js.map +1 -0
  51. package/dist/components/shared/navbar/walletIntegration/CustomWalletConnectModal.d.ts +11 -0
  52. package/dist/components/shared/navbar/walletIntegration/CustomWalletConnectModal.d.ts.map +1 -0
  53. package/dist/components/shared/navbar/walletIntegration/CustomWalletConnectModal.js +38 -0
  54. package/dist/components/shared/navbar/walletIntegration/CustomWalletConnectModal.js.map +1 -0
  55. package/dist/components/shared/navbar/walletIntegration/FingerprintListbox.d.ts +8 -0
  56. package/dist/components/shared/navbar/walletIntegration/FingerprintListbox.d.ts.map +1 -0
  57. package/dist/components/shared/navbar/walletIntegration/FingerprintListbox.js +25 -0
  58. package/dist/components/shared/navbar/walletIntegration/FingerprintListbox.js.map +1 -0
  59. package/dist/components/shared/navbar/walletIntegration/WalletConnectQR.d.ts +8 -0
  60. package/dist/components/shared/navbar/walletIntegration/WalletConnectQR.d.ts.map +1 -0
  61. package/dist/components/shared/navbar/walletIntegration/WalletConnectQR.js +35 -0
  62. package/dist/components/shared/navbar/walletIntegration/WalletConnectQR.js.map +1 -0
  63. package/dist/components/shared/navbar/walletIntegration/WalletConnectSession.d.ts +8 -0
  64. package/dist/components/shared/navbar/walletIntegration/WalletConnectSession.d.ts.map +1 -0
  65. package/dist/components/shared/navbar/walletIntegration/WalletConnectSession.js +64 -0
  66. package/dist/components/shared/navbar/walletIntegration/WalletConnectSession.js.map +1 -0
  67. package/dist/constants/sage-methods.d.ts +41 -0
  68. package/dist/constants/sage-methods.d.ts.map +1 -0
  69. package/dist/constants/sage-methods.js +71 -0
  70. package/dist/constants/sage-methods.js.map +1 -0
  71. package/dist/constants/wallet-connect.d.ts +49 -0
  72. package/dist/constants/wallet-connect.d.ts.map +1 -0
  73. package/dist/constants/wallet-connect.js +127 -0
  74. package/dist/constants/wallet-connect.js.map +1 -0
  75. package/dist/hooks/useWalletConnectRestore.d.ts +35 -0
  76. package/dist/hooks/useWalletConnectRestore.d.ts.map +1 -0
  77. package/dist/hooks/useWalletConnectRestore.js +122 -0
  78. package/dist/hooks/useWalletConnectRestore.js.map +1 -0
  79. package/dist/hooks/useWalletConnectionState.d.ts +27 -0
  80. package/dist/hooks/useWalletConnectionState.d.ts.map +1 -0
  81. package/dist/hooks/useWalletConnectionState.js +49 -0
  82. package/dist/hooks/useWalletConnectionState.js.map +1 -0
  83. package/dist/hooks.d.ts +7 -0
  84. package/dist/hooks.d.ts.map +1 -0
  85. package/dist/hooks.js +7 -0
  86. package/dist/hooks.js.map +1 -0
  87. package/dist/index.d.ts +25 -0
  88. package/dist/index.d.ts.map +1 -0
  89. package/dist/index.js +65 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/package.json +16 -0
  92. package/dist/state/completeWithWalletSlice.d.ts +18 -0
  93. package/dist/state/completeWithWalletSlice.d.ts.map +1 -0
  94. package/dist/state/completeWithWalletSlice.js +31 -0
  95. package/dist/state/completeWithWalletSlice.js.map +1 -0
  96. package/dist/state/globalOnLoadDataSlice.d.ts +17 -0
  97. package/dist/state/globalOnLoadDataSlice.d.ts.map +1 -0
  98. package/dist/state/globalOnLoadDataSlice.js +44 -0
  99. package/dist/state/globalOnLoadDataSlice.js.map +1 -0
  100. package/dist/state/settingsModalSlice.d.ts +7 -0
  101. package/dist/state/settingsModalSlice.d.ts.map +1 -0
  102. package/dist/state/settingsModalSlice.js +21 -0
  103. package/dist/state/settingsModalSlice.js.map +1 -0
  104. package/dist/state/store.d.ts +21 -0
  105. package/dist/state/store.d.ts.map +1 -0
  106. package/dist/state/store.js +110 -0
  107. package/dist/state/store.js.map +1 -0
  108. package/dist/state/walletConnectSlice.d.ts +16 -0
  109. package/dist/state/walletConnectSlice.d.ts.map +1 -0
  110. package/dist/state/walletConnectSlice.js +71 -0
  111. package/dist/state/walletConnectSlice.js.map +1 -0
  112. package/dist/state/walletSlice.d.ts +12 -0
  113. package/dist/state/walletSlice.d.ts.map +1 -0
  114. package/dist/state/walletSlice.js +44 -0
  115. package/dist/state/walletSlice.js.map +1 -0
  116. package/dist/styles/globals.css +54 -0
  117. package/dist/utils/analyticsUtils.d.ts +5 -0
  118. package/dist/utils/analyticsUtils.d.ts.map +1 -0
  119. package/dist/utils/analyticsUtils.js +32 -0
  120. package/dist/utils/analyticsUtils.js.map +1 -0
  121. package/dist/utils/deviceDetection.d.ts +14 -0
  122. package/dist/utils/deviceDetection.d.ts.map +1 -0
  123. package/dist/utils/deviceDetection.js +81 -0
  124. package/dist/utils/deviceDetection.js.map +1 -0
  125. package/dist/utils/logger.d.ts +13 -0
  126. package/dist/utils/logger.d.ts.map +1 -0
  127. package/dist/utils/logger.js +68 -0
  128. package/dist/utils/logger.js.map +1 -0
  129. package/dist/utils/walletIntegration/restoreConnectionState.d.ts +7 -0
  130. package/dist/utils/walletIntegration/restoreConnectionState.d.ts.map +1 -0
  131. package/dist/utils/walletIntegration/restoreConnectionState.js +145 -0
  132. package/dist/utils/walletIntegration/restoreConnectionState.js.map +1 -0
  133. package/dist/utils/walletIntegration/walletIntegrationInterface.d.ts +35 -0
  134. package/dist/utils/walletIntegration/walletIntegrationInterface.d.ts.map +1 -0
  135. package/dist/utils/walletIntegration/walletIntegrationInterface.js +3 -0
  136. package/dist/utils/walletIntegration/walletIntegrationInterface.js.map +1 -0
  137. package/dist/utils/walletIntegration/walletManager.d.ts +18 -0
  138. package/dist/utils/walletIntegration/walletManager.d.ts.map +1 -0
  139. package/dist/utils/walletIntegration/walletManager.js +118 -0
  140. package/dist/utils/walletIntegration/walletManager.js.map +1 -0
  141. package/dist/utils/walletIntegration/wallets/walletConnect.d.ts +65 -0
  142. package/dist/utils/walletIntegration/wallets/walletConnect.d.ts.map +1 -0
  143. package/dist/utils/walletIntegration/wallets/walletConnect.js +891 -0
  144. package/dist/utils/walletIntegration/wallets/walletConnect.js.map +1 -0
  145. package/package.json +107 -0
  146. package/tailwind.config.js +27 -0
package/dist/index.js ADDED
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ // Note: Styles must be imported separately by consumers
3
+ // import '@maximedogawa/chia-wallet-connect-react/styles';
4
+ var __importDefault = (this && this.__importDefault) || function (mod) {
5
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.SafeImage = exports.CopyButton = exports.Modal = exports.setRequestStep = exports.setOfferRejected = exports.setUserMustAddTheseAssetsToWallet = exports.setSelectedFingerprint = exports.deleteTopicFromFingerprintMemory = exports.setSessions = exports.selectSession = exports.setPairingUri = exports.connectSession = exports.setCNSName = exports.setAddress = exports.setConnectedWallet = exports.restoreConnectionState = exports.restoreConnectionStateImmediate = exports.useWalletConnectRestore = exports.useWalletConnectionState = exports.useAppSelector = exports.useAppDispatch = exports.persistor = exports.store = exports.WalletConnect = exports.WalletManager = exports.FingerprintListbox = exports.AddAssetButton = exports.WalletConnectSession = exports.WalletConnectQR = exports.ConnectWalletModal = exports.ConnectButton = void 0;
9
+ var ConnectButton_1 = require("./components/shared/navbar/walletIntegration/ConnectButton");
10
+ Object.defineProperty(exports, "ConnectButton", { enumerable: true, get: function () { return __importDefault(ConnectButton_1).default; } });
11
+ var ConnectWalletModal_1 = require("./components/shared/navbar/walletIntegration/ConnectWalletModal");
12
+ Object.defineProperty(exports, "ConnectWalletModal", { enumerable: true, get: function () { return __importDefault(ConnectWalletModal_1).default; } });
13
+ var WalletConnectQR_1 = require("./components/shared/navbar/walletIntegration/WalletConnectQR");
14
+ Object.defineProperty(exports, "WalletConnectQR", { enumerable: true, get: function () { return __importDefault(WalletConnectQR_1).default; } });
15
+ var WalletConnectSession_1 = require("./components/shared/navbar/walletIntegration/WalletConnectSession");
16
+ Object.defineProperty(exports, "WalletConnectSession", { enumerable: true, get: function () { return __importDefault(WalletConnectSession_1).default; } });
17
+ var AddAssetButton_1 = require("./components/shared/navbar/walletIntegration/AddAssetButton");
18
+ Object.defineProperty(exports, "AddAssetButton", { enumerable: true, get: function () { return __importDefault(AddAssetButton_1).default; } });
19
+ var FingerprintListbox_1 = require("./components/shared/navbar/walletIntegration/FingerprintListbox");
20
+ Object.defineProperty(exports, "FingerprintListbox", { enumerable: true, get: function () { return __importDefault(FingerprintListbox_1).default; } });
21
+ // Core utilities
22
+ var walletManager_1 = require("./utils/walletIntegration/walletManager");
23
+ Object.defineProperty(exports, "WalletManager", { enumerable: true, get: function () { return __importDefault(walletManager_1).default; } });
24
+ var walletConnect_1 = require("./utils/walletIntegration/wallets/walletConnect");
25
+ Object.defineProperty(exports, "WalletConnect", { enumerable: true, get: function () { return __importDefault(walletConnect_1).default; } });
26
+ // Redux store and hooks
27
+ var store_1 = require("./state/store");
28
+ Object.defineProperty(exports, "store", { enumerable: true, get: function () { return __importDefault(store_1).default; } });
29
+ Object.defineProperty(exports, "persistor", { enumerable: true, get: function () { return store_1.persistor; } });
30
+ var hooks_1 = require("./hooks");
31
+ Object.defineProperty(exports, "useAppDispatch", { enumerable: true, get: function () { return hooks_1.useAppDispatch; } });
32
+ Object.defineProperty(exports, "useAppSelector", { enumerable: true, get: function () { return hooks_1.useAppSelector; } });
33
+ // Connection state hooks
34
+ var useWalletConnectionState_1 = require("./hooks/useWalletConnectionState");
35
+ Object.defineProperty(exports, "useWalletConnectionState", { enumerable: true, get: function () { return useWalletConnectionState_1.useWalletConnectionState; } });
36
+ var useWalletConnectRestore_1 = require("./hooks/useWalletConnectRestore");
37
+ Object.defineProperty(exports, "useWalletConnectRestore", { enumerable: true, get: function () { return useWalletConnectRestore_1.useWalletConnectRestore; } });
38
+ Object.defineProperty(exports, "restoreConnectionStateImmediate", { enumerable: true, get: function () { return useWalletConnectRestore_1.restoreConnectionStateImmediate; } });
39
+ // Connection state restoration utility
40
+ var restoreConnectionState_1 = require("./utils/walletIntegration/restoreConnectionState");
41
+ Object.defineProperty(exports, "restoreConnectionState", { enumerable: true, get: function () { return restoreConnectionState_1.restoreConnectionState; } });
42
+ // Redux slices and actions
43
+ var walletSlice_1 = require("./state/walletSlice");
44
+ Object.defineProperty(exports, "setConnectedWallet", { enumerable: true, get: function () { return walletSlice_1.setConnectedWallet; } });
45
+ Object.defineProperty(exports, "setAddress", { enumerable: true, get: function () { return walletSlice_1.setAddress; } });
46
+ Object.defineProperty(exports, "setCNSName", { enumerable: true, get: function () { return walletSlice_1.setCNSName; } });
47
+ var walletConnectSlice_1 = require("./state/walletConnectSlice");
48
+ Object.defineProperty(exports, "connectSession", { enumerable: true, get: function () { return walletConnectSlice_1.connectSession; } });
49
+ Object.defineProperty(exports, "setPairingUri", { enumerable: true, get: function () { return walletConnectSlice_1.setPairingUri; } });
50
+ Object.defineProperty(exports, "selectSession", { enumerable: true, get: function () { return walletConnectSlice_1.selectSession; } });
51
+ Object.defineProperty(exports, "setSessions", { enumerable: true, get: function () { return walletConnectSlice_1.setSessions; } });
52
+ Object.defineProperty(exports, "deleteTopicFromFingerprintMemory", { enumerable: true, get: function () { return walletConnectSlice_1.deleteTopicFromFingerprintMemory; } });
53
+ Object.defineProperty(exports, "setSelectedFingerprint", { enumerable: true, get: function () { return walletConnectSlice_1.setSelectedFingerprint; } });
54
+ var completeWithWalletSlice_1 = require("./state/completeWithWalletSlice");
55
+ Object.defineProperty(exports, "setUserMustAddTheseAssetsToWallet", { enumerable: true, get: function () { return completeWithWalletSlice_1.setUserMustAddTheseAssetsToWallet; } });
56
+ Object.defineProperty(exports, "setOfferRejected", { enumerable: true, get: function () { return completeWithWalletSlice_1.setOfferRejected; } });
57
+ Object.defineProperty(exports, "setRequestStep", { enumerable: true, get: function () { return completeWithWalletSlice_1.setRequestStep; } });
58
+ // Shared components (if needed)
59
+ var Modal_1 = require("./components/shared/Modal");
60
+ Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return __importDefault(Modal_1).default; } });
61
+ var CopyButton_1 = require("./components/shared/CopyButton");
62
+ Object.defineProperty(exports, "CopyButton", { enumerable: true, get: function () { return __importDefault(CopyButton_1).default; } });
63
+ var SafeImage_1 = require("./components/shared/SafeImage");
64
+ Object.defineProperty(exports, "SafeImage", { enumerable: true, get: function () { return __importDefault(SafeImage_1).default; } });
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,wDAAwD;AACxD,2DAA2D;;;;;;AAE3D,4FAAsG;AAA7F,+HAAA,OAAO,OAAiB;AAEjC,sGAAgH;AAAvG,yIAAA,OAAO,OAAsB;AACtC,gGAA0G;AAAjG,mIAAA,OAAO,OAAmB;AACnC,0GAAoH;AAA3G,6IAAA,OAAO,OAAwB;AACxC,8FAAwG;AAA/F,iIAAA,OAAO,OAAkB;AAClC,sGAAgH;AAAvG,yIAAA,OAAO,OAAsB;AAEtC,iBAAiB;AACjB,yEAAmF;AAA1E,+HAAA,OAAO,OAAiB;AACjC,iFAA2F;AAAlF,+HAAA,OAAO,OAAiB;AAGjC,wBAAwB;AACxB,uCAA4D;AAAnD,+GAAA,OAAO,OAAS;AAAE,kGAAA,SAAS,OAAA;AAEpC,iCAAyD;AAAhD,uGAAA,cAAc,OAAA;AAAE,uGAAA,cAAc,OAAA;AAEvC,yBAAyB;AACzB,6EAA4E;AAAnE,oIAAA,wBAAwB,OAAA;AACjC,2EAA2G;AAAlG,kIAAA,uBAAuB,OAAA;AAAE,0IAAA,+BAA+B,OAAA;AAEjE,uCAAuC;AACvC,2FAA0F;AAAjF,gIAAA,sBAAsB,OAAA;AAG/B,2BAA2B;AAC3B,mDAAiF;AAAxE,iHAAA,kBAAkB,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,yGAAA,UAAU,OAAA;AACnD,iEAOoC;AANlC,oHAAA,cAAc,OAAA;AACd,mHAAA,aAAa,OAAA;AACb,mHAAA,aAAa,OAAA;AACb,iHAAA,WAAW,OAAA;AACX,sIAAA,gCAAgC,OAAA;AAChC,4HAAA,sBAAsB,OAAA;AAExB,2EAIyC;AAHvC,4IAAA,iCAAiC,OAAA;AACjC,2HAAA,gBAAgB,OAAA;AAChB,yHAAA,cAAc,OAAA;AAMhB,gCAAgC;AAChC,mDAA6D;AAApD,+GAAA,OAAO,OAAS;AACzB,6DAAuE;AAA9D,yHAAA,OAAO,OAAc;AAC9B,2DAAqE;AAA5D,uHAAA,OAAO,OAAa"}
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@maximedogawa/chia-wallet-connect-react",
3
+ "version": "0.0.1",
4
+ "main": "./index.js",
5
+ "module": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./index.js",
10
+ "require": "./index.js",
11
+ "types": "./index.d.ts"
12
+ },
13
+ "./styles": "./styles/globals.css",
14
+ "./tailwind.config": "../tailwind.config.js"
15
+ }
16
+ }
@@ -0,0 +1,18 @@
1
+ import { generateOffer } from '../utils/walletIntegration/walletIntegrationInterface';
2
+ export interface completeWithWalletSliceState {
3
+ requestStep: null | "getWallets" | "addAssets" | "getWalletsAgain" | "generateOffer";
4
+ userMustAddTheseAssetsToWallet: generateOffer["offerAssets"];
5
+ offerRejected: boolean;
6
+ }
7
+ export declare const setRequestStep: import("@reduxjs/toolkit").ActionCreatorWithPayload<"getWallets" | "addAssets" | "getWalletsAgain" | "generateOffer" | null, "completeWithWallet/setRequestStep">, setUserMustAddTheseAssetsToWallet: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
8
+ assetId: string;
9
+ hiddenPuzzleHash: string | null;
10
+ amount: number;
11
+ image_url: string;
12
+ short_name: string;
13
+ name: string;
14
+ walletId?: number;
15
+ }[] | [], "completeWithWallet/setUserMustAddTheseAssetsToWallet">, setOfferRejected: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "completeWithWallet/setOfferRejected">;
16
+ declare const _default: import("redux").Reducer<completeWithWalletSliceState>;
17
+ export default _default;
18
+ //# sourceMappingURL=completeWithWalletSlice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completeWithWalletSlice.d.ts","sourceRoot":"","sources":["../../src/state/completeWithWalletSlice.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AAErF,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,IAAI,GAAG,YAAY,GAAG,WAAW,GAAG,iBAAiB,GAAG,eAAe,CAAC;IACrF,8BAA8B,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC7D,aAAa,EAAE,OAAO,CAAC;CACxB;AA6BD,eAAO,MAAQ,cAAc,qKAAE,iCAAiC;;;;;;;;mEAAE,gBAAgB,qGAAoC,CAAC;;AAEvH,wBAA+C"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.setOfferRejected = exports.setUserMustAddTheseAssetsToWallet = exports.setRequestStep = void 0;
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ // SLICES
7
+ /////////////////////////////////
8
+ const initialState = {
9
+ requestStep: null,
10
+ userMustAddTheseAssetsToWallet: [],
11
+ offerRejected: false
12
+ };
13
+ const completeWithWalletSlice = (0, toolkit_1.createSlice)({
14
+ name: 'completeWithWallet',
15
+ initialState,
16
+ reducers: {
17
+ setRequestStep(state, action) {
18
+ const newStep = action.payload;
19
+ state.requestStep = newStep;
20
+ },
21
+ setUserMustAddTheseAssetsToWallet(state, action) {
22
+ state.userMustAddTheseAssetsToWallet = action.payload;
23
+ },
24
+ setOfferRejected(state, action) {
25
+ state.offerRejected = action.payload;
26
+ }
27
+ },
28
+ });
29
+ _a = completeWithWalletSlice.actions, exports.setRequestStep = _a.setRequestStep, exports.setUserMustAddTheseAssetsToWallet = _a.setUserMustAddTheseAssetsToWallet, exports.setOfferRejected = _a.setOfferRejected;
30
+ exports.default = completeWithWalletSlice.reducer;
31
+ //# sourceMappingURL=completeWithWalletSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completeWithWalletSlice.js","sourceRoot":"","sources":["../../src/state/completeWithWalletSlice.tsx"],"names":[],"mappings":";;;;AAAA,8CAA8D;AAU9D,SAAS;AACT,iCAAiC;AACjC,MAAM,YAAY,GAAiC;IACjD,WAAW,EAAE,IAAI;IACjB,8BAA8B,EAAE,EAAE;IAClC,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,MAAM,uBAAuB,GAAG,IAAA,qBAAW,EAAC;IAC1C,IAAI,EAAE,oBAAoB;IAC1B,YAAY;IACZ,QAAQ,EAAE;QACR,cAAc,CAAC,KAAK,EAAE,MAA8F;YAClH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;YAC/B,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;QAC9B,CAAC;QAED,iCAAiC,CAAC,KAAK,EAAE,MAAwD;YAC/F,KAAK,CAAC,8BAA8B,GAAG,MAAM,CAAC,OAAO,CAAC;QACxD,CAAC;QAED,gBAAgB,CAAC,KAAK,EAAE,MAA8B;YACpD,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC;QACvC,CAAC;KACF;CACF,CAAC,CAAC;AAEU,KAA0E,uBAAuB,CAAC,OAAO,EAAvG,sBAAc,sBAAE,yCAAiC,yCAAE,wBAAgB,uBAAqC;AAEvH,kBAAe,uBAAuB,CAAC,OAAO,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { Pair } from '../api';
2
+ export interface globalOnLoadDataSliceState {
3
+ pairs: Pair[] | null;
4
+ }
5
+ export declare const getPairs: import("@reduxjs/toolkit").AsyncThunk<Pair[], void, {
6
+ state?: unknown;
7
+ dispatch?: import("redux").Dispatch;
8
+ extra?: unknown;
9
+ rejectValue?: unknown;
10
+ serializedErrorType?: unknown;
11
+ pendingMeta?: unknown;
12
+ fulfilledMeta?: unknown;
13
+ rejectedMeta?: unknown;
14
+ }>;
15
+ declare const _default: import("redux").Reducer<globalOnLoadDataSliceState>;
16
+ export default _default;
17
+ //# sourceMappingURL=globalOnLoadDataSlice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalOnLoadDataSlice.d.ts","sourceRoot":"","sources":["../../src/state/globalOnLoadDataSlice.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,IAAI,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;CACtB;AAID,eAAO,MAAM,QAAQ;;;;;;;;;EAenB,CAAC;;AAwBH,wBAA6C"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPairs = void 0;
4
+ const toolkit_1 = require("@reduxjs/toolkit");
5
+ const api_1 = require("../api");
6
+ // ASYNC
7
+ /////////////////////////////////
8
+ exports.getPairs = (0, toolkit_1.createAsyncThunk)('wallet/getPairs', async (_, { getState }) => {
9
+ const state = getState();
10
+ // If tokens have previously been loaded
11
+ if (state.globalOnLoadData.pairs)
12
+ return state.globalOnLoadData.pairs;
13
+ // On first request
14
+ try {
15
+ return await (0, api_1.getAllPairs)();
16
+ }
17
+ catch (error) {
18
+ if (error instanceof Error && error.message) {
19
+ // Error logged by async thunk rejection handler
20
+ }
21
+ throw error;
22
+ }
23
+ });
24
+ // SLICES
25
+ /////////////////////////////////
26
+ const initialState = {
27
+ pairs: null,
28
+ };
29
+ const globalOnLoadDataSlice = (0, toolkit_1.createSlice)({
30
+ name: 'globalOnLoadData',
31
+ initialState,
32
+ reducers: {},
33
+ extraReducers(builder) {
34
+ builder
35
+ // GET TOKENS
36
+ //////////////////////////////////
37
+ .addCase(exports.getPairs.fulfilled, (state, action) => {
38
+ state.pairs = action.payload;
39
+ });
40
+ },
41
+ });
42
+ // export const { } = globalOnLoadDataSlice.actions;
43
+ exports.default = globalOnLoadDataSlice.reducer;
44
+ //# sourceMappingURL=globalOnLoadDataSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalOnLoadDataSlice.js","sourceRoot":"","sources":["../../src/state/globalOnLoadDataSlice.ts"],"names":[],"mappings":";;;AAAA,8CAAgF;AAIhF,+BAA0C;AAM1C,QAAQ;AACR,iCAAiC;AACpB,QAAA,QAAQ,GAAG,IAAA,0BAAgB,EAAC,iBAAiB,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpF,MAAM,KAAK,GAAG,QAAQ,EAAe,CAAC;IAEtC,wCAAwC;IACxC,IAAI,KAAK,CAAC,gBAAgB,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC;IAEtE,mBAAmB;IACnB,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,iBAAW,GAAE,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAC5C,gDAAgD;QAClD,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,SAAS;AACT,iCAAiC;AACjC,MAAM,YAAY,GAA+B;IAC/C,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,MAAM,qBAAqB,GAAG,IAAA,qBAAW,EAAC;IACxC,IAAI,EAAE,kBAAkB;IACxB,YAAY;IACZ,QAAQ,EAAE,EAAE;IACZ,aAAa,CAAC,OAAO;QACnB,OAAO;YACL,aAAa;YACb,kCAAkC;aACjC,OAAO,CAAC,gBAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,MAA6B,EAAE,EAAE;YACpE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,CAAC,CAAC,CAAA;IACN,CAAC;CACF,CAAC,CAAC;AAEH,qDAAqD;AAErD,kBAAe,qBAAqB,CAAC,OAAO,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface settingsModalSliceState {
2
+ isOpen: boolean;
3
+ }
4
+ export declare const setIsOpen: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, "settingsModal/setIsOpen">;
5
+ declare const _default: import("redux").Reducer<settingsModalSliceState>;
6
+ export default _default;
7
+ //# sourceMappingURL=settingsModalSlice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsModalSlice.d.ts","sourceRoot":"","sources":["../../src/state/settingsModalSlice.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,OAAO,CAAC;CACjB;AAkBD,eAAO,MAAQ,SAAS,yFAA+B,CAAC;;AAExD,wBAA0C"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setIsOpen = void 0;
4
+ const toolkit_1 = require("@reduxjs/toolkit");
5
+ // SLICES
6
+ /////////////////////////////////
7
+ const initialState = {
8
+ isOpen: false
9
+ };
10
+ const settingsModalSlice = (0, toolkit_1.createSlice)({
11
+ name: 'settingsModal',
12
+ initialState,
13
+ reducers: {
14
+ setIsOpen(state, action) {
15
+ state.isOpen = action.payload;
16
+ },
17
+ },
18
+ });
19
+ exports.setIsOpen = settingsModalSlice.actions.setIsOpen;
20
+ exports.default = settingsModalSlice.reducer;
21
+ //# sourceMappingURL=settingsModalSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsModalSlice.js","sourceRoot":"","sources":["../../src/state/settingsModalSlice.tsx"],"names":[],"mappings":";;;AAAA,8CAA8D;AAM9D,SAAS;AACT,iCAAiC;AACjC,MAAM,YAAY,GAA4B;IAC5C,MAAM,EAAE,KAAK;CACd,CAAC;AAEF,MAAM,kBAAkB,GAAG,IAAA,qBAAW,EAAC;IACrC,IAAI,EAAE,eAAe;IACrB,YAAY;IACZ,QAAQ,EAAE;QACR,SAAS,CAAC,KAAK,EAAE,MAA8B;YAC7C,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;QAChC,CAAC;KACF;CACF,CAAC,CAAC;AAEY,iBAAS,GAAK,kBAAkB,CAAC,OAAO,WAAC;AAExD,kBAAe,kBAAkB,CAAC,OAAO,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { TypedUseSelectorHook } from 'react-redux';
2
+ declare const store: import("@reduxjs/toolkit/dist/configureStore.js").ToolkitStore<import("redux").EmptyObject & {
3
+ completeWithWallet: import("./completeWithWalletSlice.js").completeWithWalletSliceState;
4
+ globalOnLoadData: import("./globalOnLoadDataSlice.js").globalOnLoadDataSliceState;
5
+ walletConnect: import("./walletConnectSlice.js").WalletConnectState;
6
+ settingsModal: import("./settingsModalSlice.js").settingsModalSliceState;
7
+ wallet: import("./walletSlice.js").WalletState;
8
+ } & import("redux-persist/es/persistReducer").PersistPartial, import("redux").AnyAction, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<import("redux").EmptyObject & {
9
+ completeWithWallet: import("./completeWithWalletSlice.js").completeWithWalletSliceState;
10
+ globalOnLoadData: import("./globalOnLoadDataSlice.js").globalOnLoadDataSliceState;
11
+ walletConnect: import("./walletConnectSlice.js").WalletConnectState;
12
+ settingsModal: import("./settingsModalSlice.js").settingsModalSliceState;
13
+ wallet: import("./walletSlice.js").WalletState;
14
+ } & import("redux-persist/es/persistReducer").PersistPartial, import("redux").AnyAction>]>>;
15
+ export declare const persistor: import("redux-persist").Persistor;
16
+ export declare const useAppDispatch: () => import("redux").Dispatch<import("redux").AnyAction>;
17
+ export declare const useAppSelector: TypedUseSelectorHook<RootState>;
18
+ export type RootState = ReturnType<typeof store.getState>;
19
+ export type AppDispatch = typeof store.dispatch;
20
+ export default store;
21
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/state/store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAA4B,MAAM,aAAa,CAAC;AAsE7E,QAAA,MAAM,KAAK;;;;;;;;;;;;2FAQT,CAAC;AAEH,eAAO,MAAM,SAAS,mCAAsB,CAAC;AAE7C,eAAO,MAAM,cAAc,2DAAsB,CAAC;AAClD,eAAO,MAAM,cAAc,EAAE,oBAAoB,CAAC,SAAS,CAAe,CAAC;AAE3E,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,OAAO,KAAK,CAAC,QAAQ,CAAC;AAEhD,eAAe,KAAK,CAAC"}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.useAppSelector = exports.useAppDispatch = exports.persistor = void 0;
40
+ const toolkit_1 = require("@reduxjs/toolkit");
41
+ const react_redux_1 = require("react-redux");
42
+ const redux_persist_1 = require("redux-persist");
43
+ const completeWithWalletSlice_js_1 = __importDefault(require("./completeWithWalletSlice.js"));
44
+ const globalOnLoadDataSlice_js_1 = __importDefault(require("./globalOnLoadDataSlice.js"));
45
+ const settingsModalSlice_js_1 = __importDefault(require("./settingsModalSlice.js"));
46
+ const walletConnectSlice_js_1 = __importDefault(require("./walletConnectSlice.js"));
47
+ const walletSlice_js_1 = __importDefault(require("./walletSlice.js"));
48
+ // Use conditional storage for SSR compatibility
49
+ // For ESM, we use a synchronous import pattern that works in both browser and SSR
50
+ let storage;
51
+ if (typeof window !== 'undefined') {
52
+ // In browser, use dynamic import (will be handled at runtime)
53
+ Promise.resolve().then(() => __importStar(require('redux-persist/lib/storage'))).then((module) => {
54
+ storage = module.default;
55
+ });
56
+ // Fallback: create temporary storage until import completes
57
+ storage = {
58
+ getItem(_key) {
59
+ return Promise.resolve(null);
60
+ },
61
+ setItem(_key, value) {
62
+ return Promise.resolve(value);
63
+ },
64
+ removeItem(_key) {
65
+ return Promise.resolve();
66
+ },
67
+ };
68
+ }
69
+ else {
70
+ // Create a noop storage for SSR
71
+ storage = {
72
+ getItem(_key) {
73
+ return Promise.resolve(null);
74
+ },
75
+ setItem(_key, value) {
76
+ return Promise.resolve(value);
77
+ },
78
+ removeItem(_key) {
79
+ return Promise.resolve();
80
+ },
81
+ };
82
+ }
83
+ const rootReducer = (0, toolkit_1.combineReducers)({
84
+ completeWithWallet: completeWithWalletSlice_js_1.default,
85
+ globalOnLoadData: globalOnLoadDataSlice_js_1.default,
86
+ walletConnect: walletConnectSlice_js_1.default,
87
+ settingsModal: settingsModalSlice_js_1.default,
88
+ wallet: walletSlice_js_1.default,
89
+ });
90
+ const persistConfig = {
91
+ key: 'root',
92
+ version: 1,
93
+ storage,
94
+ blacklist: ['completeWithWallet', 'settingsModal', 'globalOnLoadData'],
95
+ };
96
+ const persistedReducer = (0, redux_persist_1.persistReducer)(persistConfig, rootReducer);
97
+ const store = (0, toolkit_1.configureStore)({
98
+ reducer: persistedReducer,
99
+ middleware: (getDefaultMiddleware) => getDefaultMiddleware({
100
+ serializableCheck: {
101
+ ignoredActions: [redux_persist_1.FLUSH, redux_persist_1.REHYDRATE, redux_persist_1.PAUSE, redux_persist_1.PERSIST, redux_persist_1.PURGE, redux_persist_1.REGISTER],
102
+ },
103
+ }),
104
+ });
105
+ exports.persistor = (0, redux_persist_1.persistStore)(store);
106
+ const useAppDispatch = () => (0, react_redux_1.useDispatch)();
107
+ exports.useAppDispatch = useAppDispatch;
108
+ exports.useAppSelector = react_redux_1.useSelector;
109
+ exports.default = store;
110
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/state/store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAmE;AACnE,6CAA6E;AAC7E,iDASuB;AAEvB,8FAAqE;AACrE,0FAAiE;AACjE,oFAA2D;AAC3D,oFAA2D;AAC3D,sEAA6C;AAE7C,gDAAgD;AAChD,kFAAkF;AAClF,IAAI,OAAY,CAAC;AACjB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,8DAA8D;IAC9D,kDAAO,2BAA2B,IAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;QAClD,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,4DAA4D;IAC5D,OAAO,GAAG;QACR,OAAO,CAAC,IAAY;YAClB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,CAAC,IAAY,EAAE,KAAU;YAC9B,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,UAAU,CAAC,IAAY;YACrB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC;KAAM,CAAC;IACN,gCAAgC;IAChC,OAAO,GAAG;QACR,OAAO,CAAC,IAAY;YAClB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,CAAC,IAAY,EAAE,KAAU;YAC9B,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QACD,UAAU,CAAC,IAAY;YACrB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAG,IAAA,yBAAe,EAAC;IAClC,kBAAkB,EAAE,oCAAyB;IAC7C,gBAAgB,EAAE,kCAAuB;IACzC,aAAa,EAAE,+BAAoB;IACnC,aAAa,EAAE,+BAAoB;IACnC,MAAM,EAAE,wBAAa;CACtB,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG;IACpB,GAAG,EAAE,MAAM;IACX,OAAO,EAAE,CAAC;IACV,OAAO;IACP,SAAS,EAAE,CAAC,oBAAoB,EAAE,eAAe,EAAE,kBAAkB,CAAC;CACvE,CAAC;AAEF,MAAM,gBAAgB,GAAG,IAAA,8BAAc,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AAEpE,MAAM,KAAK,GAAG,IAAA,wBAAc,EAAC;IAC3B,OAAO,EAAE,gBAAgB;IACzB,UAAU,EAAE,CAAC,oBAAoB,EAAE,EAAE,CACnC,oBAAoB,CAAC;QACnB,iBAAiB,EAAE;YACjB,cAAc,EAAE,CAAC,qBAAK,EAAE,yBAAS,EAAE,qBAAK,EAAE,uBAAO,EAAE,qBAAK,EAAE,wBAAQ,CAAC;SACpE;KACF,CAAC;CACL,CAAC,CAAC;AAEU,QAAA,SAAS,GAAG,IAAA,4BAAY,EAAC,KAAK,CAAC,CAAC;AAEtC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,IAAA,yBAAW,GAAE,CAAC;AAArC,QAAA,cAAc,kBAAuB;AACrC,QAAA,cAAc,GAAoC,yBAAW,CAAC;AAK3E,kBAAe,KAAK,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { SessionTypes } from "@walletconnect/types";
2
+ export interface WalletConnectState {
3
+ sessions: SessionTypes.Struct[] | [];
4
+ selectedSession: SessionTypes.Struct | null | void;
5
+ selectedFingerprint: {
6
+ [topic: string]: number;
7
+ };
8
+ pairingUri: string | null;
9
+ }
10
+ export declare const connectSession: import("@reduxjs/toolkit").ActionCreatorWithPayload<SessionTypes.Struct | null, "walletConnect/connectSession">, setSessions: import("@reduxjs/toolkit").ActionCreatorWithPayload<[] | SessionTypes.Struct[], "walletConnect/setSessions">, selectSession: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "walletConnect/selectSession">, setSelectedFingerprint: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
11
+ topic: string;
12
+ selectedFingerprint: number;
13
+ }, "walletConnect/setSelectedFingerprint">, setPairingUri: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "walletConnect/setPairingUri">, deleteTopicFromFingerprintMemory: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "walletConnect/deleteTopicFromFingerprintMemory">;
14
+ declare const _default: import("redux").Reducer<WalletConnectState>;
15
+ export default _default;
16
+ //# sourceMappingURL=walletConnectSlice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletConnectSlice.d.ts","sourceRoot":"","sources":["../../src/state/walletConnectSlice.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC;IACrC,eAAe,EAAE,YAAY,CAAC,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACnD,mBAAmB,EAAE;QACnB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;KACzB,CAAA;IACD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AA2ED,eAAO,MAAQ,cAAc,mHAAE,WAAW,gHAAE,aAAa,8FAAE,sBAAsB;WA/BjB,MAAM;yBAAuB,MAAM;4CA+BhB,aAAa,qGAAE,gCAAgC,+GAA+B,CAAC;;AAElK,wBAA0C"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.deleteTopicFromFingerprintMemory = exports.setPairingUri = exports.setSelectedFingerprint = exports.selectSession = exports.setSessions = exports.connectSession = void 0;
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ // SLICES
7
+ /////////////////////////////////
8
+ const initialState = {
9
+ sessions: [],
10
+ selectedSession: null,
11
+ selectedFingerprint: {},
12
+ pairingUri: null
13
+ };
14
+ const walletConnectSlice = (0, toolkit_1.createSlice)({
15
+ name: 'walletConnect',
16
+ initialState,
17
+ reducers: {
18
+ connectSession(state, action) {
19
+ const newSession = action.payload;
20
+ // Set the active session as the newly connected one
21
+ if (newSession) {
22
+ state.selectedSession = newSession;
23
+ state.selectedFingerprint[newSession.topic] = Number(newSession.namespaces.chia.accounts[0].split(":")[2]);
24
+ }
25
+ },
26
+ setSessions(state, action) {
27
+ const sessions = action.payload;
28
+ state.sessions = sessions;
29
+ },
30
+ selectSession(state, action) {
31
+ const topic = action.payload;
32
+ // Check if the provided session topic is in the sessions array
33
+ const selectedSession = state.sessions.find(session => session.topic === topic);
34
+ if (selectedSession) {
35
+ state.selectedSession = selectedSession;
36
+ }
37
+ else {
38
+ // Provided session topic is not valid - log error but don't break functionality
39
+ // eslint-disable-next-line no-console
40
+ console.error(`Invalid session topic: ${topic}`);
41
+ }
42
+ },
43
+ setSelectedFingerprint(state, action) {
44
+ const { topic, selectedFingerprint } = action.payload;
45
+ state.selectedFingerprint[topic] = selectedFingerprint;
46
+ },
47
+ deleteTopicFromFingerprintMemory(state, action) {
48
+ const topic = action.payload;
49
+ if (topic in state.selectedFingerprint) {
50
+ delete state.selectedFingerprint[topic];
51
+ }
52
+ // If no more sessions exist, set selectedSession to null
53
+ if (!state.sessions.length) {
54
+ state.selectedSession = null;
55
+ state.selectedFingerprint = {};
56
+ return;
57
+ }
58
+ // If user disconnects the currently selected session, select the next available one
59
+ if (state.sessions.length && state.selectedSession && topic === state.selectedSession.topic) {
60
+ state.selectedSession = state.sessions[state.sessions.length - 1];
61
+ }
62
+ },
63
+ setPairingUri(state, action) {
64
+ const uri = action.payload;
65
+ state.pairingUri = uri;
66
+ },
67
+ }
68
+ });
69
+ _a = walletConnectSlice.actions, exports.connectSession = _a.connectSession, exports.setSessions = _a.setSessions, exports.selectSession = _a.selectSession, exports.setSelectedFingerprint = _a.setSelectedFingerprint, exports.setPairingUri = _a.setPairingUri, exports.deleteTopicFromFingerprintMemory = _a.deleteTopicFromFingerprintMemory;
70
+ exports.default = walletConnectSlice.reducer;
71
+ //# sourceMappingURL=walletConnectSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletConnectSlice.js","sourceRoot":"","sources":["../../src/state/walletConnectSlice.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,12 @@
1
+ import { walletNamesType } from '../utils/walletIntegration/walletIntegrationInterface';
2
+ export interface WalletState {
3
+ connectedWallet: walletNamesType["walletNames"] | null;
4
+ address: string | null;
5
+ image: string | null;
6
+ name: string | null;
7
+ CNSName: string | null;
8
+ }
9
+ export declare const setConnectedWallet: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "wallet/setConnectedWallet">, setCNSName: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "wallet/setCNSName">, setAddress: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "wallet/setAddress">;
10
+ declare const _default: import("redux").Reducer<WalletState>;
11
+ export default _default;
12
+ //# sourceMappingURL=walletSlice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletSlice.d.ts","sourceRoot":"","sources":["../../src/state/walletSlice.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAC;AAEvF,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,eAAe,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC;IACvD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAwCD,eAAO,MAAQ,kBAAkB,yFAAE,UAAU,iFAAE,UAAU,+EAAwB,CAAC;;AAElF,wBAAmC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.setAddress = exports.setCNSName = exports.setConnectedWallet = void 0;
5
+ const toolkit_1 = require("@reduxjs/toolkit");
6
+ // SLICES
7
+ /////////////////////////////////
8
+ const initialState = {
9
+ connectedWallet: null,
10
+ address: null,
11
+ image: null,
12
+ name: null,
13
+ CNSName: null,
14
+ };
15
+ const walletSlice = (0, toolkit_1.createSlice)({
16
+ name: 'wallet',
17
+ initialState,
18
+ reducers: {
19
+ setConnectedWallet(state, action) {
20
+ if (!action.payload) {
21
+ state.connectedWallet = null;
22
+ state.address = null;
23
+ state.image = null;
24
+ state.name = null;
25
+ state.CNSName = null;
26
+ return;
27
+ }
28
+ state.connectedWallet = action.payload.wallet;
29
+ state.address = action.payload.address;
30
+ state.image = action.payload.image;
31
+ state.name = action.payload.name;
32
+ state.CNSName = null;
33
+ },
34
+ setCNSName(state, action) {
35
+ state.CNSName = action.payload;
36
+ },
37
+ setAddress(state, action) {
38
+ state.address = action.payload;
39
+ }
40
+ }
41
+ });
42
+ _a = walletSlice.actions, exports.setConnectedWallet = _a.setConnectedWallet, exports.setCNSName = _a.setCNSName, exports.setAddress = _a.setAddress;
43
+ exports.default = walletSlice.reducer;
44
+ //# sourceMappingURL=walletSlice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletSlice.js","sourceRoot":"","sources":["../../src/state/walletSlice.ts"],"names":[],"mappings":";;;;AAAA,8CAA+C;AAY/C,SAAS;AACT,iCAAiC;AACjC,MAAM,YAAY,GAAgB;IAChC,eAAe,EAAE,IAAI;IACrB,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;CACd,CAAC;AAEF,MAAM,WAAW,GAAG,IAAA,qBAAW,EAAC;IAC9B,IAAI,EAAE,QAAQ;IACd,YAAY;IACZ,QAAQ,EAAE;QACR,kBAAkB,CAAC,KAAK,EAAE,MAAM;YAC9B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;gBAC7B,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;gBACrB,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;gBACnB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;gBAClB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;gBACrB,OAAM;YACR,CAAC;YACD,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;YAC9C,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YACvC,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;YACnC,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;YACjC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QACvB,CAAC;QACD,UAAU,CAAC,KAAK,EAAE,MAAM;YACtB,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAChC,CAAC;QACD,UAAU,CAAC,KAAK,EAAE,MAAM;YACtB,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;QAChC,CAAC;KACF;CACF,CAAC,CAAC;AAEU,KAAiD,WAAW,CAAC,OAAO,EAAlE,0BAAkB,0BAAE,kBAAU,kBAAE,kBAAU,iBAAyB;AAElF,kBAAe,WAAW,CAAC,OAAO,CAAC"}
@@ -0,0 +1,54 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ html, body {
6
+ scrollbar-gutter: stable;
7
+ }
8
+
9
+ *::selection {
10
+ background: #526e78;
11
+ color: #EFF4F7;
12
+ }
13
+
14
+ .faq-answer a {
15
+ text-decoration: underline;
16
+ }
17
+
18
+ input[type="number"]::-webkit-inner-spin-button,
19
+ input[type="number"]::-webkit-outer-spin-button {
20
+ -webkit-appearance: none;
21
+ margin: 0;
22
+ }
23
+ input[type="number"] {
24
+ -moz-appearance: textfield;
25
+ }
26
+
27
+ /* Remove vertical line on <TokenSelector /> */
28
+ span.css-1u9des2-indicatorSeparator {
29
+ display: none;
30
+ }
31
+
32
+ /* Pretty Scrollbar */
33
+ *::-webkit-scrollbar {
34
+ width: 14px;
35
+ height: 18px;
36
+ }
37
+
38
+ *::-webkit-scrollbar-button {
39
+ display: none;
40
+ width: 0;
41
+ height: 0;
42
+ }
43
+
44
+ *::-webkit-scrollbar-corner {
45
+ background-color: transparent;
46
+ }
47
+
48
+ *::-webkit-scrollbar-thumb {
49
+ height: 30px;
50
+ border: 4px solid transparent;
51
+ background-clip: padding-box;
52
+ background-color: rgba(82, 110, 120, 0.1);
53
+ -webkit-border-radius: 7px;
54
+ }
@@ -0,0 +1,5 @@
1
+ export declare function formatWithComma(value: number, num_digits?: number): string;
2
+ export declare function formatToken(mojos: number, asChange?: boolean): string;
3
+ export declare function formatDollars(value: number): string;
4
+ export declare function mojoToXCHString(value: number, showAsChange?: boolean): string;
5
+ //# sourceMappingURL=analyticsUtils.d.ts.map