@rango-dev/wallets-react 0.27.1-next.11 → 0.27.1-next.12

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.
@@ -1 +1 @@
1
- {"inputs":{"src/hub/constants.ts":{"bytes":146,"imports":[],"format":"esm"},"src/hub/lastConnectedWallets.ts":{"bytes":4867,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"src/hub/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/helpers.ts":{"bytes":4652,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"src/hub/constants.ts","kind":"import-statement","original":"../hub/constants.js"},{"path":"src/hub/lastConnectedWallets.ts","kind":"import-statement","original":"../hub/lastConnectedWallets.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/context.ts":{"bytes":905,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/autoConnect.ts":{"bytes":2046,"imports":[{"path":"src/hub/lastConnectedWallets.ts","kind":"import-statement","original":"../hub/lastConnectedWallets.js"},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/hooks.ts":{"bytes":1545,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/legacy/context.ts","kind":"import-statement","original":"./context.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/utils.ts":{"bytes":230,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/useAutoConnect.ts":{"bytes":628,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/legacy/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/useLegacyProviders.ts":{"bytes":7308,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/legacy/autoConnect.ts","kind":"import-statement","original":"./autoConnect.js"},{"path":"src/legacy/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/legacy/hooks.ts","kind":"import-statement","original":"./hooks.js"},{"path":"src/legacy/useAutoConnect.ts","kind":"import-statement","original":"./useAutoConnect.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/mod.ts":{"bytes":321,"imports":[{"path":"src/hub/constants.ts","kind":"import-statement","original":"../hub/constants.js"},{"path":"src/legacy/context.ts","kind":"import-statement","original":"./context.js"},{"path":"src/legacy/useLegacyProviders.ts","kind":"import-statement","original":"./useLegacyProviders.js"}],"format":"esm"},"src/hub/helpers.ts":{"bytes":2307,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/utils.ts":{"bytes":10648,"imports":[{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"../legacy/mod.js"},{"path":"src/hub/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/hub/lastConnectedWallets.ts","kind":"import-statement","original":"./lastConnectedWallets.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/autoConnect.ts":{"bytes":7018,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"../legacy/mod.js"},{"path":"src/hub/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/hub/lastConnectedWallets.ts","kind":"import-statement","original":"./lastConnectedWallets.js"},{"path":"src/hub/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/useHubRefs.ts":{"bytes":1365,"imports":[{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hub/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/useHubAdapter.ts":{"bytes":11338,"imports":[{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"../legacy/mod.js"},{"path":"src/legacy/useAutoConnect.ts","kind":"import-statement","original":"../legacy/useAutoConnect.js"},{"path":"src/hub/autoConnect.ts","kind":"import-statement","original":"./autoConnect.js"},{"path":"src/hub/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/hub/lastConnectedWallets.ts","kind":"import-statement","original":"./lastConnectedWallets.js"},{"path":"src/hub/useHubRefs.ts","kind":"import-statement","original":"./useHubRefs.js"},{"path":"src/hub/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/mod.ts":{"bytes":162,"imports":[{"path":"src/hub/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/hub/useHubAdapter.ts","kind":"import-statement","original":"./useHubAdapter.js"}],"format":"esm"},"src/useProviders.ts":{"bytes":3425,"imports":[{"path":"src/hub/mod.ts","kind":"import-statement","original":"./hub/mod.js"},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"./legacy/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/provider.tsx":{"bytes":405,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/legacy/context.ts","kind":"import-statement","original":"./legacy/context.js"},{"path":"src/useProviders.ts","kind":"import-statement","original":"./useProviders.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/types.ts":{"bytes":5147,"imports":[],"format":"esm"},"src/index.ts":{"bytes":173,"imports":[{"path":"src/legacy/helpers.ts","kind":"import-statement","original":"./legacy/helpers.js"},{"path":"src/provider.tsx","kind":"import-statement","original":"./provider.js"},{"path":"src/legacy/hooks.ts","kind":"import-statement","original":"./legacy/hooks.js"},{"path":"src/legacy/types.ts","kind":"import-statement","original":"./legacy/types.js"}],"format":"esm"},"src/helpers/index.ts":{"bytes":55,"imports":[{"path":"src/hub/mod.ts","kind":"import-statement","original":"../hub/mod.js"}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":95643},"dist/index.js":{"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Events","Provider","availableWallets","checkWalletProviders","choose","clearPersistance","connectedWallets","defaultWalletState","isAsync","makeEventHandler","needsCheckInstallation","stateReducer","tryPersistWallet","tryRemoveWalletFromPersistance","useWallets"],"entryPoint":"src/index.ts","inputs":{"src/legacy/helpers.ts":{"bytesInOutput":1401},"src/hub/constants.ts":{"bytesInOutput":65},"src/hub/lastConnectedWallets.ts":{"bytesInOutput":1210},"src/index.ts":{"bytesInOutput":0},"src/provider.tsx":{"bytesInOutput":133},"src/legacy/context.ts":{"bytesInOutput":431},"src/hub/utils.ts":{"bytesInOutput":2902},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/useLegacyProviders.ts":{"bytesInOutput":2126},"src/legacy/autoConnect.ts":{"bytesInOutput":393},"src/legacy/hooks.ts":{"bytesInOutput":460},"src/legacy/useAutoConnect.ts":{"bytesInOutput":197},"src/legacy/utils.ts":{"bytesInOutput":94},"src/hub/helpers.ts":{"bytesInOutput":822},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":3681},"src/hub/autoConnect.ts":{"bytesInOutput":2054},"src/hub/useHubRefs.ts":{"bytesInOutput":510},"src/useProviders.ts":{"bytesInOutput":885},"src/legacy/types.ts":{"bytesInOutput":164}},"bytes":17967},"dist/helpers/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":59715},"dist/helpers/index.js":{"imports":[{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["getAllLegacyProviders"],"entryPoint":"src/helpers/index.ts","inputs":{"src/hub/utils.ts":{"bytesInOutput":547},"src/hub/constants.ts":{"bytesInOutput":65},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/context.ts":{"bytesInOutput":427},"src/legacy/useLegacyProviders.ts":{"bytesInOutput":52},"src/hub/lastConnectedWallets.ts":{"bytesInOutput":1210},"src/legacy/helpers.ts":{"bytesInOutput":59},"src/legacy/hooks.ts":{"bytesInOutput":109},"src/legacy/useAutoConnect.ts":{"bytesInOutput":46},"src/hub/helpers.ts":{"bytesInOutput":135},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":97},"src/hub/autoConnect.ts":{"bytesInOutput":119},"src/hub/useHubRefs.ts":{"bytesInOutput":97},"src/helpers/index.ts":{"bytesInOutput":0}},"bytes":3112}}}
1
+ {"inputs":{"src/hub/constants.ts":{"bytes":146,"imports":[],"format":"esm"},"src/hub/lastConnectedWallets.ts":{"bytes":4867,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"src/hub/constants.ts","kind":"import-statement","original":"./constants.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/helpers.ts":{"bytes":4652,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"src/hub/constants.ts","kind":"import-statement","original":"../hub/constants.js"},{"path":"src/hub/lastConnectedWallets.ts","kind":"import-statement","original":"../hub/lastConnectedWallets.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/context.ts":{"bytes":905,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/autoConnect.ts":{"bytes":2046,"imports":[{"path":"src/hub/lastConnectedWallets.ts","kind":"import-statement","original":"../hub/lastConnectedWallets.js"},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"./mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/hooks.ts":{"bytes":1545,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/legacy/context.ts","kind":"import-statement","original":"./context.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/utils.ts":{"bytes":230,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/useAutoConnect.ts":{"bytes":628,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/legacy/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/useLegacyProviders.ts":{"bytes":7308,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/legacy/autoConnect.ts","kind":"import-statement","original":"./autoConnect.js"},{"path":"src/legacy/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/legacy/hooks.ts","kind":"import-statement","original":"./hooks.js"},{"path":"src/legacy/useAutoConnect.ts","kind":"import-statement","original":"./useAutoConnect.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/mod.ts":{"bytes":321,"imports":[{"path":"src/hub/constants.ts","kind":"import-statement","original":"../hub/constants.js"},{"path":"src/legacy/context.ts","kind":"import-statement","original":"./context.js"},{"path":"src/legacy/useLegacyProviders.ts","kind":"import-statement","original":"./useLegacyProviders.js"}],"format":"esm"},"src/hub/helpers.ts":{"bytes":2342,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"ts-results","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/utils.ts":{"bytes":10648,"imports":[{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"../legacy/mod.js"},{"path":"src/hub/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/hub/lastConnectedWallets.ts","kind":"import-statement","original":"./lastConnectedWallets.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/autoConnect.ts":{"bytes":6964,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"ts-results","kind":"import-statement","external":true},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"../legacy/mod.js"},{"path":"src/hub/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/hub/lastConnectedWallets.ts","kind":"import-statement","original":"./lastConnectedWallets.js"},{"path":"src/hub/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/useHubRefs.ts":{"bytes":1365,"imports":[{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/hub/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/useHubAdapter.ts":{"bytes":12203,"imports":[{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"ts-results","kind":"import-statement","external":true},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"../legacy/mod.js"},{"path":"src/legacy/useAutoConnect.ts","kind":"import-statement","original":"../legacy/useAutoConnect.js"},{"path":"src/hub/autoConnect.ts","kind":"import-statement","original":"./autoConnect.js"},{"path":"src/hub/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/hub/lastConnectedWallets.ts","kind":"import-statement","original":"./lastConnectedWallets.js"},{"path":"src/hub/useHubRefs.ts","kind":"import-statement","original":"./useHubRefs.js"},{"path":"src/hub/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hub/mod.ts":{"bytes":162,"imports":[{"path":"src/hub/utils.ts","kind":"import-statement","original":"./utils.js"},{"path":"src/hub/useHubAdapter.ts","kind":"import-statement","original":"./useHubAdapter.js"}],"format":"esm"},"src/useProviders.ts":{"bytes":3425,"imports":[{"path":"src/hub/mod.ts","kind":"import-statement","original":"./hub/mod.js"},{"path":"src/legacy/mod.ts","kind":"import-statement","original":"./legacy/mod.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/provider.tsx":{"bytes":405,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/legacy/context.ts","kind":"import-statement","original":"./legacy/context.js"},{"path":"src/useProviders.ts","kind":"import-statement","original":"./useProviders.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/legacy/types.ts":{"bytes":5147,"imports":[],"format":"esm"},"src/index.ts":{"bytes":173,"imports":[{"path":"src/legacy/helpers.ts","kind":"import-statement","original":"./legacy/helpers.js"},{"path":"src/provider.tsx","kind":"import-statement","original":"./provider.js"},{"path":"src/legacy/hooks.ts","kind":"import-statement","original":"./legacy/hooks.js"},{"path":"src/legacy/types.ts","kind":"import-statement","original":"./legacy/types.js"}],"format":"esm"},"src/helpers/index.ts":{"bytes":55,"imports":[{"path":"src/hub/mod.ts","kind":"import-statement","original":"../hub/mod.js"}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":97076},"dist/index.js":{"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"ts-results","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"ts-results","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"ts-results","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["Events","Provider","availableWallets","checkWalletProviders","choose","clearPersistance","connectedWallets","defaultWalletState","isAsync","makeEventHandler","needsCheckInstallation","stateReducer","tryPersistWallet","tryRemoveWalletFromPersistance","useWallets"],"entryPoint":"src/index.ts","inputs":{"src/legacy/helpers.ts":{"bytesInOutput":1401},"src/hub/constants.ts":{"bytesInOutput":65},"src/hub/lastConnectedWallets.ts":{"bytesInOutput":1210},"src/index.ts":{"bytesInOutput":0},"src/provider.tsx":{"bytesInOutput":133},"src/legacy/context.ts":{"bytesInOutput":431},"src/hub/utils.ts":{"bytesInOutput":2902},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/useLegacyProviders.ts":{"bytesInOutput":2127},"src/legacy/autoConnect.ts":{"bytesInOutput":395},"src/legacy/hooks.ts":{"bytesInOutput":460},"src/legacy/useAutoConnect.ts":{"bytesInOutput":197},"src/legacy/utils.ts":{"bytesInOutput":94},"src/hub/helpers.ts":{"bytesInOutput":873},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":3881},"src/hub/autoConnect.ts":{"bytesInOutput":2058},"src/hub/useHubRefs.ts":{"bytesInOutput":510},"src/useProviders.ts":{"bytesInOutput":885},"src/legacy/types.ts":{"bytesInOutput":164}},"bytes":18225},"dist/helpers/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":60709},"dist/helpers/index.js":{"imports":[{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/utils","kind":"import-statement","external":true},{"path":"ts-results","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"ts-results","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"ts-results","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["getAllLegacyProviders"],"entryPoint":"src/helpers/index.ts","inputs":{"src/hub/utils.ts":{"bytesInOutput":547},"src/hub/constants.ts":{"bytesInOutput":65},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/context.ts":{"bytesInOutput":427},"src/legacy/useLegacyProviders.ts":{"bytesInOutput":52},"src/hub/lastConnectedWallets.ts":{"bytesInOutput":1210},"src/legacy/helpers.ts":{"bytesInOutput":59},"src/legacy/hooks.ts":{"bytesInOutput":109},"src/legacy/useAutoConnect.ts":{"bytesInOutput":47},"src/hub/helpers.ts":{"bytesInOutput":178},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":143},"src/hub/autoConnect.ts":{"bytesInOutput":156},"src/hub/useHubRefs.ts":{"bytesInOutput":97},"src/helpers/index.ts":{"bytesInOutput":0}},"bytes":3239}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/wallets-react",
3
- "version": "0.27.1-next.11",
3
+ "version": "0.27.1-next.12",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -37,7 +37,8 @@
37
37
  "dependencies": {
38
38
  "@rango-dev/wallets-core": "^0.40.1-next.11",
39
39
  "@rango-dev/wallets-shared": "^0.41.1-next.4",
40
- "rango-types": "^0.1.78"
40
+ "rango-types": "^0.1.78",
41
+ "ts-results": "^3.3.0"
41
42
  },
42
43
  "devDependencies": {
43
44
  "@types/react": "^18.0.25",
@@ -46,4 +47,4 @@
46
47
  "publishConfig": {
47
48
  "access": "public"
48
49
  }
49
- }
50
+ }
@@ -12,6 +12,7 @@ import {
12
12
  legacyEagerConnectHandler,
13
13
  legacyIsEvmNamespace,
14
14
  } from '@rango-dev/wallets-core/legacy';
15
+ import { Result } from 'ts-results';
15
16
 
16
17
  import { HUB_LAST_CONNECTED_WALLETS } from '../legacy/mod.js';
17
18
 
@@ -97,7 +98,7 @@ async function eagerConnect(
97
98
 
98
99
  const failedNamespaces: LegacyNamespaceInputForConnect[] = [];
99
100
  connectNamespacesResult.forEach((result, index) => {
100
- if (result instanceof Error) {
101
+ if (result.err) {
101
102
  failedNamespaces.push(targetNamespaces[index][0]);
102
103
  }
103
104
  });
@@ -109,16 +110,13 @@ async function eagerConnect(
109
110
  );
110
111
  }
111
112
 
112
- const atLeastOneNamespaceConnectedSuccessfully =
113
- connectNamespacesResult.length - failedNamespaces.length > 0;
113
+ const atLeastOneNamespaceConnectedSuccessfully = connectNamespacesResult.some(
114
+ (result) => result.ok
115
+ );
114
116
  if (!atLeastOneNamespaceConnectedSuccessfully) {
115
117
  throw new Error(`No namespace connected for ${type}`);
116
118
  }
117
-
118
- const successfulResult = connectNamespacesResult.filter(
119
- (result) => !(result instanceof Error)
120
- );
121
- return successfulResult;
119
+ return Result.all(...connectNamespacesResult).unwrap();
122
120
  }
123
121
 
124
122
  /*
@@ -142,7 +140,7 @@ export async function autoConnect(deps: {
142
140
  const walletsToRemoveFromPersistance: string[] = [];
143
141
 
144
142
  if (walletIds.length) {
145
- const eagerConnectQueue: any[] = [];
143
+ const eagerConnectQueue: unknown[] = [];
146
144
 
147
145
  // Run `.connect` if `.canEagerConnect` returns `true`.
148
146
  walletIds.forEach((providerName) => {
@@ -157,10 +155,10 @@ export async function autoConnect(deps: {
157
155
 
158
156
  const legacyProvider = getLegacyProvider(providerName);
159
157
 
160
- let legacyInstance: any;
158
+ let legacyInstance: unknown;
161
159
  try {
162
160
  legacyInstance = legacyProvider.getInstance();
163
- } catch (e) {
161
+ } catch {
164
162
  console.warn(
165
163
  "It seems instance isn't available yet for auto connect. This can happen when extension not loaded yet (sometimes when opening browser for first time) or extension is disabled. Desired wallet:",
166
164
  providerName
@@ -3,9 +3,11 @@ import type {
3
3
  Accounts,
4
4
  AccountsWithActiveChain,
5
5
  } from '@rango-dev/wallets-core/namespaces/common';
6
+ import type { Result } from 'ts-results';
6
7
 
7
8
  import { legacyFormatAddressWithNetwork as formatAddressWithNetwork } from '@rango-dev/wallets-core/legacy';
8
9
  import { CAIP } from '@rango-dev/wallets-core/utils';
10
+ import { Err, Ok } from 'ts-results';
9
11
 
10
12
  export function mapCaipNamespaceToLegacyNetworkName(
11
13
  chainId: CAIP.ChainIdParams | string
@@ -42,22 +44,19 @@ export function fromAccountIdToLegacyAddressFormat(account: string): string {
42
44
  /**
43
45
  * Getting a list of (lazy) promises and run them one after another.
44
46
  */
45
- export async function runSequentiallyWithoutFailure<
46
- T extends () => Promise<unknown>
47
- >(
48
- promises: Array<T>
49
- ): Promise<Array<T extends () => Promise<infer R> ? R : never>> {
50
- const result = await promises.reduce(async (prev, task) => {
51
- const previousResults = await prev;
47
+
48
+ export async function runSequentiallyWithoutFailure<R>(
49
+ promises: Array<() => Promise<R>>
50
+ ): Promise<Result<R, unknown>[]> {
51
+ return promises.reduce(async (prevPromise, task) => {
52
+ const previousResults = await prevPromise;
52
53
  try {
53
54
  const taskResult = await task();
54
-
55
- return [...previousResults, taskResult];
55
+ return [...previousResults, new Ok(taskResult)];
56
56
  } catch (error) {
57
- return [...previousResults, error];
57
+ return [...previousResults, new Err(error)];
58
58
  }
59
- }, Promise.resolve([]) as Promise<any>);
60
- return result;
59
+ }, Promise.resolve<Result<R, unknown>[]>([]));
61
60
  }
62
61
 
63
62
  export function isConnectResultEvm(
@@ -6,6 +6,7 @@ import type { VersionedProviders } from '@rango-dev/wallets-core/utils';
6
6
 
7
7
  import { type WalletInfo } from '@rango-dev/wallets-shared';
8
8
  import { useEffect, useRef, useState } from 'react';
9
+ import { Ok, Result } from 'ts-results';
9
10
 
10
11
  import {
11
12
  type ConnectResult,
@@ -16,11 +17,11 @@ import {
16
17
  import { useAutoConnect } from '../legacy/useAutoConnect.js';
17
18
 
18
19
  import { autoConnect } from './autoConnect.js';
19
- import { fromAccountIdToLegacyAddressFormat } from './helpers.js';
20
20
  import {
21
- LastConnectedWalletsFromStorage,
22
- type NamespaceInput,
23
- } from './lastConnectedWallets.js';
21
+ fromAccountIdToLegacyAddressFormat,
22
+ runSequentiallyWithoutFailure,
23
+ } from './helpers.js';
24
+ import { LastConnectedWalletsFromStorage } from './lastConnectedWallets.js';
24
25
  import { useHubRefs } from './useHubRefs.js';
25
26
  import {
26
27
  checkHubStateAndTriggerEvents,
@@ -166,12 +167,9 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
166
167
  targetNamespaces.push([namespace, result]);
167
168
  });
168
169
 
169
- // Keeping only namespaces that connected successfully, then we'll store them on storage for auto connect functionality.
170
- const successfulyConnectedNamespaces: NamespaceInput[] = [];
171
-
172
170
  // Try to run `connect` on matched namespaces
173
171
  const connectResultFromTargetNamespaces = targetNamespaces.map(
174
- async ([namespaceInput, namespace]) => {
172
+ ([namespaceInput, namespace]) => {
175
173
  const network = tryConvertNamespaceNetworkToChainInfo(
176
174
  namespaceInput,
177
175
  params.allBlockChains || []
@@ -182,41 +180,67 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
182
180
  * our assumption here is all the `connect` hasn't chain or if they have, they will accept it in first argument.
183
181
  * By this assumption, always passing a chain should be problematic since it will be ignored if the namespace's `connect` hasn't chain.
184
182
  */
185
- const result = namespace.connect(network);
186
- return result
187
- .then<ConnectResult>(transformHubResultToLegacyResult)
188
- .then((res) => {
189
- successfulyConnectedNamespaces.push({
190
- namespace: namespaceInput.namespace,
191
- network: namespaceInput.network,
183
+ return async () =>
184
+ namespace
185
+ .connect(network)
186
+ .then<ConnectResult>(transformHubResultToLegacyResult)
187
+ .then((connectResult) => {
188
+ return {
189
+ response: connectResult,
190
+ input: {
191
+ namespace: namespaceInput.namespace,
192
+ network: namespaceInput.network,
193
+ },
194
+ };
192
195
  });
193
- return res;
194
- });
195
196
  }
196
197
  );
197
198
 
199
+ /*
200
+ * We need to connect to namespace one after another, sending multiple requests at the same time may be failed.
201
+ * e.g. when wallet popup opens and asking for the password from the user, it should be resolved first, then other request will be resolved.
202
+ */
203
+ const connectResultWithLegacyFormat = await runSequentiallyWithoutFailure(
204
+ connectResultFromTargetNamespaces
205
+ );
206
+
207
+ // Keeping only namespaces that connected successfully, then we'll store them on storage for auto connect functionality.
208
+ const successfullyConnectedNamespaces = connectResultWithLegacyFormat
209
+ .filter(<T, E>(result: Result<T, E>): result is Ok<T> => result.ok)
210
+ .map((result) => {
211
+ return {
212
+ namespace: result.val.input.namespace,
213
+ network: result.val.input.network,
214
+ };
215
+ });
216
+
198
217
  // If Provider has support for auto connect, we will add the wallet to storage.
199
218
  const legacyProvider = getLegacyProvider(
200
219
  params.allVersionedProviders,
201
220
  type
202
221
  );
203
222
 
204
- if (legacyProvider.canEagerConnect) {
205
- void Promise.allSettled(connectResultFromTargetNamespaces).then(() => {
206
- if (successfulyConnectedNamespaces.length > 0) {
207
- lastConnectedWalletsFromStorage.addWallet(
208
- type,
209
- successfulyConnectedNamespaces
210
- );
211
- }
212
- });
223
+ if (
224
+ legacyProvider.canEagerConnect &&
225
+ successfullyConnectedNamespaces.length > 0
226
+ ) {
227
+ lastConnectedWalletsFromStorage.addWallet(
228
+ type,
229
+ successfullyConnectedNamespaces
230
+ );
213
231
  }
214
232
 
215
- const connectResultWithLegacyFormat = await Promise.all(
216
- connectResultFromTargetNamespaces
233
+ // Getting rid of `input` from Result
234
+ const connectResults = connectResultWithLegacyFormat.map((result) =>
235
+ result.andThen((okResult) => new Ok(okResult.response))
217
236
  );
218
237
 
219
- return connectResultWithLegacyFormat;
238
+ const allResult = Result.all(...connectResults);
239
+ if (allResult.err) {
240
+ throw allResult.val;
241
+ }
242
+
243
+ return allResult.unwrap();
220
244
  },
221
245
  async disconnect(type) {
222
246
  const wallet = getHub().get(type);
@@ -235,7 +259,7 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
235
259
  }
236
260
  },
237
261
  async disconnectAll() {
238
- const disconnectPromises: Promise<any>[] = Array.from(
262
+ const disconnectPromises: Promise<void>[] = Array.from(
239
263
  getHub().getAll().values()
240
264
  ).map(async (provider) => this.disconnect(provider.id));
241
265