@rango-dev/wallets-react 0.30.2-next.1 → 0.30.2-next.2

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":4921,"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":2587,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/utxo","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":9403,"imports":[{"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":7725,"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":12200,"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":5369,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true}],"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":97203},"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/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/namespaces/utxo","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},{"path":"@rango-dev/wallets-core/legacy","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":1224},"src/index.ts":{"bytesInOutput":0},"src/provider.tsx":{"bytesInOutput":133},"src/legacy/context.ts":{"bytesInOutput":431},"src/hub/utils.ts":{"bytesInOutput":3159},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/useLegacyProviders.ts":{"bytesInOutput":2125},"src/legacy/autoConnect.ts":{"bytesInOutput":393},"src/legacy/hooks.ts":{"bytesInOutput":458},"src/legacy/useAutoConnect.ts":{"bytesInOutput":196},"src/legacy/utils.ts":{"bytesInOutput":92},"src/hub/helpers.ts":{"bytesInOutput":1019},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":3929},"src/hub/autoConnect.ts":{"bytesInOutput":1977},"src/hub/useHubRefs.ts":{"bytesInOutput":510},"src/useProviders.ts":{"bytesInOutput":885},"src/legacy/types.ts":{"bytesInOutput":63}},"bytes":18499},"dist/helpers/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":60440},"dist/helpers/index.js":{"imports":[{"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/namespaces/utxo","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":421},"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":1224},"src/legacy/helpers.ts":{"bytesInOutput":59},"src/legacy/hooks.ts":{"bytesInOutput":109},"src/legacy/useAutoConnect.ts":{"bytesInOutput":47},"src/hub/helpers.ts":{"bytesInOutput":259},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":143},"src/hub/autoConnect.ts":{"bytesInOutput":124},"src/hub/useHubRefs.ts":{"bytesInOutput":97},"src/helpers/index.ts":{"bytesInOutput":0}},"bytes":3176}}}
1
+ {"inputs":{"src/hub/constants.ts":{"bytes":146,"imports":[],"format":"esm"},"src/hub/lastConnectedWallets.ts":{"bytes":5519,"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":895,"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":7407,"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":2587,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/utxo","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":9403,"imports":[{"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":7725,"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":12875,"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":3458,"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":5596,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true}],"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":99586},"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/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/namespaces/utxo","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},{"path":"@rango-dev/wallets-core/legacy","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":1311},"src/index.ts":{"bytesInOutput":0},"src/provider.tsx":{"bytesInOutput":133},"src/legacy/context.ts":{"bytesInOutput":431},"src/hub/utils.ts":{"bytesInOutput":3159},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/useLegacyProviders.ts":{"bytesInOutput":2125},"src/legacy/autoConnect.ts":{"bytesInOutput":393},"src/legacy/hooks.ts":{"bytesInOutput":458},"src/legacy/useAutoConnect.ts":{"bytesInOutput":196},"src/legacy/utils.ts":{"bytesInOutput":92},"src/hub/helpers.ts":{"bytesInOutput":1019},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":4120},"src/hub/autoConnect.ts":{"bytesInOutput":1977},"src/hub/useHubRefs.ts":{"bytesInOutput":510},"src/useProviders.ts":{"bytesInOutput":889},"src/legacy/types.ts":{"bytesInOutput":63}},"bytes":18781},"dist/helpers/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":62084},"dist/helpers/index.js":{"imports":[{"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/namespaces/utxo","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":421},"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":1311},"src/legacy/helpers.ts":{"bytesInOutput":59},"src/legacy/hooks.ts":{"bytesInOutput":109},"src/legacy/useAutoConnect.ts":{"bytesInOutput":48},"src/hub/helpers.ts":{"bytesInOutput":259},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":143},"src/hub/autoConnect.ts":{"bytesInOutput":124},"src/hub/useHubRefs.ts":{"bytesInOutput":97},"src/helpers/index.ts":{"bytesInOutput":0}},"bytes":3264}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/wallets-react",
3
- "version": "0.30.2-next.1",
3
+ "version": "0.30.2-next.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -35,8 +35,8 @@
35
35
  "react-dom": "^17.0.0 || ^18.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@rango-dev/wallets-core": "^0.43.1-next.0",
39
- "@rango-dev/wallets-shared": "^0.44.2-next.1",
38
+ "@rango-dev/wallets-core": "^0.43.1-next.1",
39
+ "@rango-dev/wallets-shared": "^0.44.2-next.2",
40
40
  "rango-types": "^0.1.84",
41
41
  "ts-results": "^3.3.0"
42
42
  },
@@ -79,18 +79,37 @@ export class LastConnectedWalletsFromStorage {
79
79
  }
80
80
  #addWalletToHub(providerId: string, namespaces: NamespaceInput[]): void {
81
81
  const storage = new Persistor<LastConnectedWalletsStorage>();
82
- const data = storage.getItem(this.#storageKey) || {};
82
+ const storageState = storage.getItem(this.#storageKey) || {};
83
+
84
+ let toBeAddedNamespaces = namespaces;
85
+
86
+ // If provider already exits in the storage, we should just add new namespaces to the previously added namespaces.
87
+ if (!!storageState[providerId]) {
88
+ const storedNamespaces = storageState[providerId];
89
+ toBeAddedNamespaces = storedNamespaces.concat(
90
+ namespaces.filter(
91
+ (namespace) =>
92
+ !storedNamespaces.some(
93
+ (storedNamespace) =>
94
+ storedNamespace.namespace === namespace.namespace
95
+ )
96
+ )
97
+ );
98
+ }
83
99
 
84
100
  storage.setItem(this.#storageKey, {
85
- ...data,
86
- [providerId]: namespaces,
101
+ ...storageState,
102
+ [providerId]: toBeAddedNamespaces,
87
103
  });
88
104
  }
89
105
  #addWalletToLegacy(providerId: string): void {
90
106
  const storage = new Persistor<LegacyLastConnectedWalletsStorage>();
91
- const data = storage.getItem(this.#storageKey) || [];
107
+ const storageState = storage.getItem(this.#storageKey) || [];
92
108
 
93
- storage.setItem(LEGACY_LAST_CONNECTED_WALLETS, data.concat(providerId));
109
+ storage.setItem(
110
+ LEGACY_LAST_CONNECTED_WALLETS,
111
+ storageState.concat(providerId)
112
+ );
94
113
  }
95
114
  #removeWalletsFromHub(providerIds?: string[]): void {
96
115
  const persistor = new Persistor<LastConnectedWalletsStorage>();
@@ -1,5 +1,5 @@
1
1
  import type { AllProxiedNamespaces, ExtensionLink } from './types.js';
2
- import type { Providers } from '../index.js';
2
+ import type { ProviderContext, Providers } from '../index.js';
3
3
  import type { Provider } from '@rango-dev/wallets-core';
4
4
  import type { LegacyNamespaceInputForConnect } from '@rango-dev/wallets-core/legacy';
5
5
  import type { VersionedProviders } from '@rango-dev/wallets-core/utils';
@@ -11,7 +11,6 @@ import { Ok, Result } from 'ts-results';
11
11
  import {
12
12
  type ConnectResult,
13
13
  HUB_LAST_CONNECTED_WALLETS,
14
- type ProviderContext,
15
14
  type ProviderProps,
16
15
  } from '../legacy/mod.js';
17
16
  import { useAutoConnect } from '../legacy/useAutoConnect.js';
@@ -235,7 +234,7 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
235
234
 
236
235
  return allResult.unwrap();
237
236
  },
238
- async disconnect(type) {
237
+ async disconnect(type, namespaces) {
239
238
  const wallet = getHub().get(type);
240
239
  if (!wallet) {
241
240
  throw new Error(
@@ -244,13 +243,23 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
244
243
  }
245
244
 
246
245
  wallet.getAll().forEach((namespace) => {
247
- if (namespace.state()[0]().connected) {
246
+ const namespaceShouldBeDisconnected =
247
+ !namespaces || namespaces.includes(namespace.namespaceId);
248
+ const namespaceIsConnected = namespace.state()[0]().connected;
249
+ if (namespaceShouldBeDisconnected && namespaceIsConnected) {
248
250
  return namespace.disconnect();
249
251
  }
250
252
  });
251
253
 
252
254
  if (params.autoConnect) {
253
- lastConnectedWalletsFromStorage.removeWallets([type]);
255
+ if (namespaces) {
256
+ lastConnectedWalletsFromStorage.removeNamespacesFromWallet(
257
+ type,
258
+ namespaces
259
+ );
260
+ } else {
261
+ lastConnectedWalletsFromStorage.removeWallets([type]);
262
+ }
254
263
  }
255
264
  },
256
265
  async disconnectAll() {
@@ -341,29 +350,38 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
341
350
  return output;
342
351
  },
343
352
  state(type) {
344
- const result = getHub().state();
345
- const provider = result[type];
353
+ const hubState = getHub().state();
354
+ const wallet = getHub().get(type);
355
+ const walletState = hubState[type];
346
356
 
347
- if (!provider) {
357
+ if (!walletState || !wallet) {
348
358
  throw new Error(
349
359
  `It seems your requested provider doesn't exist in hub. Provider Id: ${type}`
350
360
  );
351
361
  }
352
362
 
353
- const accounts = provider.namespaces
363
+ const accounts = walletState.namespaces
354
364
  .filter((namespace) => namespace.connected)
355
365
  .flatMap((namespace) =>
356
366
  namespace.accounts?.map(fromAccountIdToLegacyAddressFormat)
357
367
  )
358
368
  .filter((account): account is string => !!account);
359
369
 
370
+ const namespacesState = new Map(
371
+ Array.from(wallet.getAll(), ([_, value]) => [
372
+ value.namespaceId,
373
+ value.state()[0](),
374
+ ])
375
+ );
376
+
360
377
  const coreState = {
361
- connected: provider.connected,
362
- connecting: provider.connecting,
363
- installed: provider.installed,
378
+ connected: walletState.connected,
379
+ connecting: walletState.connecting,
380
+ installed: walletState.installed,
364
381
  reachable: true,
365
382
  accounts: accounts,
366
383
  network: null,
384
+ namespaces: namespacesState,
367
385
  };
368
386
  return coreState;
369
387
  },
@@ -2,34 +2,34 @@ import type { ProviderContext } from './types.js';
2
2
 
3
3
  import { createContext } from 'react';
4
4
 
5
- const defaultErrorMesssage = "Context hasn't been initialized yet.";
5
+ const defaultErrorMessage = "Context hasn't been initialized yet.";
6
6
  const defaultContext: ProviderContext = {
7
7
  async connect() {
8
- throw new Error(defaultErrorMesssage);
8
+ throw new Error(defaultErrorMessage);
9
9
  },
10
10
  async disconnect() {
11
- throw new Error(defaultErrorMesssage);
11
+ throw new Error(defaultErrorMessage);
12
12
  },
13
13
  async disconnectAll() {
14
- throw new Error(defaultErrorMesssage);
14
+ throw new Error(defaultErrorMessage);
15
15
  },
16
16
  async suggestAndConnect() {
17
- throw new Error(defaultErrorMesssage);
17
+ throw new Error(defaultErrorMessage);
18
18
  },
19
19
  state() {
20
- throw new Error(defaultErrorMesssage);
20
+ throw new Error(defaultErrorMessage);
21
21
  },
22
22
  canSwitchNetworkTo() {
23
- throw new Error(defaultErrorMesssage);
23
+ throw new Error(defaultErrorMessage);
24
24
  },
25
25
  providers() {
26
- throw new Error(defaultErrorMesssage);
26
+ throw new Error(defaultErrorMessage);
27
27
  },
28
28
  getWalletInfo() {
29
- throw new Error(defaultErrorMesssage);
29
+ throw new Error(defaultErrorMessage);
30
30
  },
31
31
  getSigners() {
32
- throw new Error(defaultErrorMesssage);
32
+ throw new Error(defaultErrorMessage);
33
33
  },
34
34
  };
35
35
 
@@ -8,6 +8,8 @@ import type {
8
8
  LegacyState as WalletState,
9
9
  LegacyWalletType as WalletType,
10
10
  } from '@rango-dev/wallets-core/legacy';
11
+ import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
12
+ import type { NamespaceData } from '@rango-dev/wallets-core/store';
11
13
  import type { BlockchainMeta, SignerFactory } from 'rango-types';
12
14
  import type { PropsWithChildren } from 'react';
13
15
 
@@ -38,10 +40,12 @@ export type ProviderContext = {
38
40
  type: WalletType,
39
41
  namespaces?: LegacyNamespaceInputForConnect[]
40
42
  ): Promise<ConnectResult[]>;
41
- disconnect(type: WalletType): Promise<void>;
43
+ disconnect(type: WalletType, namespaces?: Namespace[]): Promise<void>;
42
44
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
43
45
  disconnectAll(): Promise<PromiseSettledResult<any>[]>;
44
- state(type: WalletType): WalletState;
46
+ state(
47
+ type: WalletType
48
+ ): WalletState & { namespaces?: Map<Namespace, NamespaceData> };
45
49
  canSwitchNetworkTo(type: WalletType, network: Network): boolean;
46
50
  /**
47
51
  * `Provider` in legacy terms means injected instances by wallets into window (e.g. window.ethereum)
@@ -19,6 +19,9 @@ import {
19
19
  import { useInitializers } from './hooks.js';
20
20
  import { useAutoConnect } from './useAutoConnect.js';
21
21
 
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
+ type ProviderType = any;
24
+
22
25
  export type LegacyProviderProps = Omit<ProviderProps, 'providers'> & {
23
26
  providers: LegacyProviderInterface[];
24
27
  };
@@ -86,7 +89,7 @@ export function useLegacyProviders(
86
89
  }
87
90
  },
88
91
  async disconnectAll() {
89
- const disconnect_promises: Promise<any>[] = [];
92
+ const disconnect_promises: Promise<void>[] = [];
90
93
 
91
94
  /*
92
95
  * When a wallet is initializing, a record will be added to `providersState`
@@ -134,7 +137,7 @@ export function useLegacyProviders(
134
137
  : false;
135
138
  },
136
139
  providers() {
137
- const providers: { [type in WalletType]?: any } = {};
140
+ const providers: { [type in WalletType]?: ProviderType } = {};
138
141
  availableWallets(providersState).forEach((type) => {
139
142
  const wallet = wallets.get(type);
140
143
  if (wallet) {
@@ -42,18 +42,18 @@ function useProviders(props: ProviderProps) {
42
42
  }
43
43
  return legacyApi.canSwitchNetworkTo(type, network);
44
44
  },
45
- async connect(type, network): Promise<ConnectResult[]> {
45
+ async connect(type, namespaces): Promise<ConnectResult[]> {
46
46
  const hubProvider = findProviderByType(hubProviders, type);
47
47
  if (hubProvider) {
48
- return await hubApi.connect(type, network);
48
+ return await hubApi.connect(type, namespaces);
49
49
  }
50
50
 
51
- return await legacyApi.connect(type, network);
51
+ return await legacyApi.connect(type, namespaces);
52
52
  },
53
- async disconnect(type): Promise<void> {
53
+ async disconnect(type, namespaces): Promise<void> {
54
54
  const hubProvider = findProviderByType(hubProviders, type);
55
55
  if (hubProvider) {
56
- return await hubApi.disconnect(type);
56
+ return await hubApi.disconnect(type, namespaces);
57
57
  }
58
58
 
59
59
  return await legacyApi.disconnect(type);