@rango-dev/wallets-react 0.35.1-next.1 → 0.36.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/index.js.map +2 -2
- package/dist/hub/autoConnect.d.ts.map +1 -1
- package/dist/hub/useHubAdapter.d.ts.map +1 -1
- package/dist/hub/utils.d.ts +19 -3
- package/dist/hub/utils.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/wallets-react.build.json +1 -1
- package/package.json +3 -3
- package/src/hub/autoConnect.ts +10 -3
- package/src/hub/useHubAdapter.ts +46 -9
- package/src/hub/utils.ts +37 -3
|
@@ -1 +1 @@
|
|
|
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":4604,"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":10267,"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":1271,"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":15331,"imports":[{"path":"@rango-dev/wallets-core/namespaces/evm","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":"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":3480,"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":5756,"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":107897},"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-core/namespaces/evm","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":3216},"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":197},"src/legacy/utils.ts":{"bytesInOutput":94},"src/hub/helpers.ts":{"bytesInOutput":1561},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":5318},"src/hub/autoConnect.ts":{"bytesInOutput":1977},"src/hub/useHubRefs.ts":{"bytesInOutput":497},"src/useProviders.ts":{"bytesInOutput":893},"src/legacy/types.ts":{"bytesInOutput":63}},"bytes":20572},"dist/helpers/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":67534},"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-core/namespaces/evm","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":47},"src/hub/helpers.ts":{"bytesInOutput":259},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":207},"src/hub/autoConnect.ts":{"bytesInOutput":124},"src/hub/useHubRefs.ts":{"bytesInOutput":97},"src/helpers/index.ts":{"bytesInOutput":0}},"bytes":3327}}}
|
|
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":4604,"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":11595,"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":7899,"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":1271,"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":16398,"imports":[{"path":"@rango-dev/wallets-core/namespaces/evm","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":"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":3480,"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":5756,"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":111448},"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-core/namespaces/evm","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":1403},"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":3512},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/useLegacyProviders.ts":{"bytesInOutput":2128},"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":1561},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":5562},"src/hub/autoConnect.ts":{"bytesInOutput":1995},"src/hub/useHubRefs.ts":{"bytesInOutput":497},"src/useProviders.ts":{"bytesInOutput":893},"src/legacy/types.ts":{"bytesInOutput":63}},"bytes":21140},"dist/helpers/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":70179},"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-core/namespaces/evm","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":207},"src/hub/autoConnect.ts":{"bytesInOutput":124},"src/hub/useHubRefs.ts":{"bytesInOutput":97},"src/helpers/index.ts":{"bytesInOutput":0}},"bytes":3328}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/wallets-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.1-next.0",
|
|
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.
|
|
39
|
-
"@rango-dev/wallets-shared": "^0.
|
|
38
|
+
"@rango-dev/wallets-core": "^0.49.1-next.0",
|
|
39
|
+
"@rango-dev/wallets-shared": "^0.50.1-next.0",
|
|
40
40
|
"rango-types": "^0.1.89",
|
|
41
41
|
"ts-results": "^3.3.0"
|
|
42
42
|
},
|
package/src/hub/autoConnect.ts
CHANGED
|
@@ -15,7 +15,10 @@ import { HUB_LAST_CONNECTED_WALLETS } from '../legacy/mod.js';
|
|
|
15
15
|
|
|
16
16
|
import { runSequentiallyWithoutFailure } from './helpers.js';
|
|
17
17
|
import { LastConnectedWalletsFromStorage } from './lastConnectedWallets.js';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
convertNamespaceNetworkToEvmChainId,
|
|
20
|
+
isEvmNamespace,
|
|
21
|
+
} from './utils.js';
|
|
19
22
|
|
|
20
23
|
// Getting connected wallets from storage
|
|
21
24
|
const lastConnectedWalletsFromStorage = new LastConnectedWalletsFromStorage(
|
|
@@ -70,8 +73,11 @@ async function eagerConnect(
|
|
|
70
73
|
: undefined;
|
|
71
74
|
const chain = evmChain || info.network;
|
|
72
75
|
|
|
73
|
-
return async () =>
|
|
74
|
-
|
|
76
|
+
return async () => {
|
|
77
|
+
const connectNamespacePromise = isEvmNamespace(namespace)
|
|
78
|
+
? namespace.connect(chain)
|
|
79
|
+
: namespace.connect();
|
|
80
|
+
return await connectNamespacePromise.catch((e) => {
|
|
75
81
|
/*
|
|
76
82
|
* Since we check for connect failures using `instanceof Error`
|
|
77
83
|
* this check is added here to make sure the thrown error always is an instance of `Error`
|
|
@@ -81,6 +87,7 @@ async function eagerConnect(
|
|
|
81
87
|
}
|
|
82
88
|
throw new Error(e);
|
|
83
89
|
});
|
|
90
|
+
};
|
|
84
91
|
}
|
|
85
92
|
);
|
|
86
93
|
|
package/src/hub/useHubAdapter.ts
CHANGED
|
@@ -2,10 +2,14 @@ import type { AllProxiedNamespaces, ExtensionLink } from './types.js';
|
|
|
2
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
|
+
import type {
|
|
6
|
+
Accounts,
|
|
7
|
+
AccountsWithActiveChain,
|
|
8
|
+
} from '@rango-dev/wallets-core/namespaces/common';
|
|
5
9
|
import type { VersionedProviders } from '@rango-dev/wallets-core/utils';
|
|
6
10
|
|
|
7
11
|
import { utils } from '@rango-dev/wallets-core/namespaces/evm';
|
|
8
|
-
import { type WalletInfo } from '@rango-dev/wallets-shared';
|
|
12
|
+
import { type WalletInfo, type WalletType } from '@rango-dev/wallets-shared';
|
|
9
13
|
import { useEffect, useRef, useState } from 'react';
|
|
10
14
|
import { Ok, Result } from 'ts-results';
|
|
11
15
|
|
|
@@ -23,6 +27,8 @@ import { useHubRefs } from './useHubRefs.js';
|
|
|
23
27
|
import {
|
|
24
28
|
getLegacyProvider,
|
|
25
29
|
getSupportedChainsFromProvider,
|
|
30
|
+
isEvmNamespace,
|
|
31
|
+
isSolanaNamespace,
|
|
26
32
|
mapHubEventsToLegacy,
|
|
27
33
|
transformHubResultToLegacyResult,
|
|
28
34
|
tryConvertNamespaceNetworkToChainInfo,
|
|
@@ -44,6 +50,21 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
|
|
|
44
50
|
allBlockChains: params.allBlockChains,
|
|
45
51
|
});
|
|
46
52
|
|
|
53
|
+
/*
|
|
54
|
+
* Params of each connection attempt for each wallet type are stored here.
|
|
55
|
+
* Derivation path from params is used in `mapHubEventsToLegacy` to be added to the payload of connect events.
|
|
56
|
+
*/
|
|
57
|
+
const lastConnectAttemptParamsRef = useRef<{
|
|
58
|
+
[type: WalletType]: LegacyNamespaceInputForConnect[];
|
|
59
|
+
}>({});
|
|
60
|
+
|
|
61
|
+
const updateLastConnectAttemptParams = (
|
|
62
|
+
type: WalletType,
|
|
63
|
+
namespaces: LegacyNamespaceInputForConnect[] | undefined
|
|
64
|
+
) => {
|
|
65
|
+
lastConnectAttemptParamsRef.current[type] = namespaces || [];
|
|
66
|
+
};
|
|
67
|
+
|
|
47
68
|
const queueTask = createQueue({
|
|
48
69
|
onError: (error, actions) => {
|
|
49
70
|
if (utils.isUserRejectionError(error)) {
|
|
@@ -100,7 +121,10 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
|
|
|
100
121
|
getHub(),
|
|
101
122
|
event,
|
|
102
123
|
dataRef.current.onUpdateState,
|
|
103
|
-
|
|
124
|
+
{
|
|
125
|
+
allBlockChains: dataRef.current.allBlockChains,
|
|
126
|
+
lastConnectAttemptParams: lastConnectAttemptParamsRef.current,
|
|
127
|
+
}
|
|
104
128
|
);
|
|
105
129
|
} catch (e) {
|
|
106
130
|
console.error(e);
|
|
@@ -190,6 +214,8 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
|
|
|
190
214
|
throw new Error('Passing namespace to `connect` is required.');
|
|
191
215
|
}
|
|
192
216
|
|
|
217
|
+
updateLastConnectAttemptParams(type, namespaces);
|
|
218
|
+
|
|
193
219
|
// Check `namespace` and look into hub to see how it can match given namespace to hub namespace.
|
|
194
220
|
const targetNamespaces: [
|
|
195
221
|
LegacyNamespaceInputForConnect,
|
|
@@ -216,14 +242,25 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
|
|
|
216
242
|
params.allBlockChains || []
|
|
217
243
|
);
|
|
218
244
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
245
|
+
let connectNamespacePromise:
|
|
246
|
+
| Promise<Accounts>
|
|
247
|
+
| Promise<string>
|
|
248
|
+
| Promise<AccountsWithActiveChain>;
|
|
249
|
+
|
|
250
|
+
if (isSolanaNamespace(namespace)) {
|
|
251
|
+
connectNamespacePromise = namespace.connect({
|
|
252
|
+
derivationPath: namespaceInput.derivationPath,
|
|
253
|
+
});
|
|
254
|
+
} else if (isEvmNamespace(namespace)) {
|
|
255
|
+
connectNamespacePromise = namespace.connect(network, {
|
|
256
|
+
derivationPath: namespaceInput.derivationPath,
|
|
257
|
+
});
|
|
258
|
+
} else {
|
|
259
|
+
connectNamespacePromise = namespace.connect();
|
|
260
|
+
}
|
|
261
|
+
|
|
224
262
|
const connectNamespaceProcess = async () =>
|
|
225
|
-
|
|
226
|
-
.connect(network)
|
|
263
|
+
connectNamespacePromise
|
|
227
264
|
.then<ConnectResult>(transformHubResultToLegacyResult)
|
|
228
265
|
.then((connectResult) => {
|
|
229
266
|
return {
|
package/src/hub/utils.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { AllProxiedNamespaces } from './types.js';
|
|
2
|
-
import type { Hub, Provider } from '@rango-dev/wallets-core';
|
|
2
|
+
import type { Hub, Provider, ProxiedNamespace } from '@rango-dev/wallets-core';
|
|
3
3
|
import type {
|
|
4
4
|
LegacyNamespaceInputForConnect,
|
|
5
5
|
LegacyProviderInterface,
|
|
6
6
|
LegacyEventHandler as WalletEventHandler,
|
|
7
7
|
} from '@rango-dev/wallets-core/legacy';
|
|
8
|
+
import type { CosmosActions } from '@rango-dev/wallets-core/namespaces/cosmos';
|
|
9
|
+
import type { EvmActions } from '@rango-dev/wallets-core/namespaces/evm';
|
|
10
|
+
import type { SolanaActions } from '@rango-dev/wallets-core/namespaces/solana';
|
|
11
|
+
import type { SuiActions } from '@rango-dev/wallets-core/namespaces/sui';
|
|
12
|
+
import type { UtxoActions } from '@rango-dev/wallets-core/namespaces/utxo';
|
|
8
13
|
import type { Event } from '@rango-dev/wallets-core/store';
|
|
9
14
|
|
|
10
15
|
import { LegacyEvents as Events } from '@rango-dev/wallets-core/legacy';
|
|
@@ -13,6 +18,7 @@ import { pickVersion } from '@rango-dev/wallets-core/utils';
|
|
|
13
18
|
import {
|
|
14
19
|
type AddEthereumChainParameter,
|
|
15
20
|
convertEvmBlockchainMetaToEvmChainInfo,
|
|
21
|
+
type WalletType,
|
|
16
22
|
} from '@rango-dev/wallets-shared';
|
|
17
23
|
import { type BlockchainMeta, isEvmBlockchain } from 'rango-types';
|
|
18
24
|
|
|
@@ -88,7 +94,12 @@ export function mapHubEventsToLegacy(
|
|
|
88
94
|
hub: Hub,
|
|
89
95
|
event: Event,
|
|
90
96
|
onUpdateState: WalletEventHandler,
|
|
91
|
-
|
|
97
|
+
metadata: {
|
|
98
|
+
allBlockChains: ProviderProps['allBlockChains'];
|
|
99
|
+
lastConnectAttemptParams: {
|
|
100
|
+
[type: WalletType]: LegacyNamespaceInputForConnect[];
|
|
101
|
+
};
|
|
102
|
+
}
|
|
92
103
|
): void {
|
|
93
104
|
const provider = hub.get(event.provider);
|
|
94
105
|
if (!provider) {
|
|
@@ -108,11 +119,18 @@ export function mapHubEventsToLegacy(
|
|
|
108
119
|
: undefined;
|
|
109
120
|
let accounts: string[] | null = null;
|
|
110
121
|
let network: string | null = null;
|
|
122
|
+
let derivationPath: string | undefined;
|
|
111
123
|
|
|
112
124
|
if (namespace) {
|
|
113
125
|
const [getNamespaceState] = namespace.state();
|
|
114
126
|
accounts = getNamespaceState().accounts;
|
|
115
127
|
network = getNamespaceState().network;
|
|
128
|
+
|
|
129
|
+
if (metadata.lastConnectAttemptParams[event.provider]) {
|
|
130
|
+
derivationPath = metadata.lastConnectAttemptParams[event.provider].find(
|
|
131
|
+
(namespace) => namespace.namespace === namespaceId
|
|
132
|
+
)?.derivationPath;
|
|
133
|
+
}
|
|
116
134
|
}
|
|
117
135
|
|
|
118
136
|
const [getProviderState] = provider.state();
|
|
@@ -123,12 +141,13 @@ export function mapHubEventsToLegacy(
|
|
|
123
141
|
accounts,
|
|
124
142
|
network,
|
|
125
143
|
reachable: true,
|
|
144
|
+
derivationPath,
|
|
126
145
|
};
|
|
127
146
|
|
|
128
147
|
const eventInfo = {
|
|
129
148
|
supportedBlockchains: getSupportedChainsFromProvider(
|
|
130
149
|
provider,
|
|
131
|
-
allBlockChains
|
|
150
|
+
metadata.allBlockChains
|
|
132
151
|
),
|
|
133
152
|
isContractWallet: false,
|
|
134
153
|
isHub: true,
|
|
@@ -370,3 +389,18 @@ export function synchronizeHubWithConfigProviders(
|
|
|
370
389
|
}
|
|
371
390
|
});
|
|
372
391
|
}
|
|
392
|
+
|
|
393
|
+
export function isSolanaNamespace(
|
|
394
|
+
ns: ProxiedNamespace<
|
|
395
|
+
EvmActions | SolanaActions | CosmosActions | SuiActions | UtxoActions
|
|
396
|
+
>
|
|
397
|
+
): ns is ProxiedNamespace<SolanaActions> & { namespaceId: 'Solana' } {
|
|
398
|
+
return ns.namespaceId === 'Solana';
|
|
399
|
+
}
|
|
400
|
+
export function isEvmNamespace(
|
|
401
|
+
ns: ProxiedNamespace<
|
|
402
|
+
EvmActions | SolanaActions | CosmosActions | SuiActions | UtxoActions
|
|
403
|
+
>
|
|
404
|
+
): ns is ProxiedNamespace<EvmActions> & { namespaceId: 'EVM' } {
|
|
405
|
+
return ns.namespaceId === 'EVM';
|
|
406
|
+
}
|