@rango-dev/wallets-react 0.46.0 → 0.46.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 +16 -0
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/index.js.map +3 -3
- package/dist/hub/autoConnect.d.ts.map +1 -1
- package/dist/hub/helpers.d.ts +2 -3
- package/dist/hub/helpers.d.ts.map +1 -1
- package/dist/hub/useHubAdapter.d.ts.map +1 -1
- package/dist/hub/utils.d.ts +2 -8
- package/dist/hub/utils.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/test-utils/fixtures.d.ts.map +1 -1
- package/dist/wallets-react.build.json +1 -1
- package/package.json +3 -4
- package/src/hub/autoConnect.ts +0 -16
- package/src/hub/helpers.ts +3 -19
- package/src/hub/useHubAdapter.ts +1 -38
- package/src/hub/utils.ts +3 -20
- package/src/test-utils/fixtures.ts +0 -78
- package/dist/hub/chainRegisteryConvertors.d.ts +0 -11
- package/dist/hub/chainRegisteryConvertors.d.ts.map +0 -1
- package/src/hub/chainRegisteryConvertors.ts +0 -186
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/test-utils/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,eAAO,MAAM,aAAa,+CAA+C,CAAC;AAE1E,qBAAa,aAAc,YAAW,aAAa,CAAC,cAAc,CAAC;IAC3D,WAAW,CACf,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,MAAM,CAAC;IAGZ,aAAa,CACjB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAKjD;AAED,eAAO,MAAM,cAAc,EAAE,uBA0C5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/test-utils/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,eAAO,MAAM,aAAa,+CAA+C,CAAC;AAE1E,qBAAa,aAAc,YAAW,aAAa,CAAC,cAAc,CAAC;IAC3D,WAAW,CACf,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC,MAAM,CAAC;IAGZ,aAAa,CACjB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAKjD;AAED,eAAO,MAAM,cAAc,EAAE,uBA0C5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,cAAc,EA4F3C,CAAC"}
|
|
@@ -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":960,"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":7639,"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":5733,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/cosmos","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/ton","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/tron","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":"@rango-dev/wallets-shared","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":11267,"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":9242,"imports":[{"path":"@rango-dev/wallets-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"rango-types","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/chainRegisteryConvertors.ts":{"bytes":5037,"imports":[{"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":18723,"imports":[{"path":"@rango-dev/wallets-core/namespaces/evm","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":"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/chainRegisteryConvertors.ts","kind":"import-statement","original":"./chainRegisteryConvertors.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":3661,"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":5969,"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":127188},"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/cosmos","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/ton","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/tron","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":"@rango-dev/wallets-shared","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":"rango-types","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","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"rango-types","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":1407},"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":465},"src/hub/utils.ts":{"bytesInOutput":3150},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/useLegacyProviders.ts":{"bytesInOutput":2312},"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":2241},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":6815},"src/hub/autoConnect.ts":{"bytesInOutput":2524},"src/hub/chainRegisteryConvertors.ts":{"bytesInOutput":2738},"src/hub/useHubRefs.ts":{"bytesInOutput":497},"src/useProviders.ts":{"bytesInOutput":1026},"src/legacy/types.ts":{"bytesInOutput":63}},"bytes":26335},"dist/helpers/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":75461},"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/cosmos","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/ton","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/tron","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":"@rango-dev/wallets-shared","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":"rango-types","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","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"rango-types","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":461},"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":581},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":256},"src/hub/autoConnect.ts":{"bytesInOutput":225},"src/hub/useHubRefs.ts":{"bytesInOutput":97},"src/helpers/index.ts":{"bytesInOutput":0}},"bytes":3834}}}
|
|
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":960,"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":7639,"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":5120,"imports":[{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/ton","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/tron","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":10695,"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":8535,"imports":[{"path":"@rango-dev/wallets-core","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":"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":17109,"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":3661,"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":5969,"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":113550},"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/ton","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/tron","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","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":465},"src/hub/utils.ts":{"bytesInOutput":3058},"src/legacy/mod.ts":{"bytesInOutput":0},"src/legacy/useLegacyProviders.ts":{"bytesInOutput":2309},"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":1886},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":6145},"src/hub/autoConnect.ts":{"bytesInOutput":2209},"src/hub/useHubRefs.ts":{"bytesInOutput":497},"src/useProviders.ts":{"bytesInOutput":1026},"src/legacy/types.ts":{"bytesInOutput":63}},"bytes":22153},"dist/helpers/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":71676},"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/ton","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/namespaces/tron","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","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":461},"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":436},"src/hub/mod.ts":{"bytesInOutput":0},"src/hub/useHubAdapter.ts":{"bytesInOutput":207},"src/hub/autoConnect.ts":{"bytesInOutput":176},"src/hub/useHubRefs.ts":{"bytesInOutput":97},"src/helpers/index.ts":{"bytesInOutput":0}},"bytes":3591}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/wallets-react",
|
|
3
|
-
"version": "0.46.0",
|
|
3
|
+
"version": "0.46.1-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -35,13 +35,12 @@
|
|
|
35
35
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@rango-dev/wallets-core": "^0.59.0",
|
|
39
|
-
"@rango-dev/wallets-shared": "^0.60.0",
|
|
38
|
+
"@rango-dev/wallets-core": "^0.59.1-next.0",
|
|
39
|
+
"@rango-dev/wallets-shared": "^0.60.1-next.0",
|
|
40
40
|
"rango-types": "^0.5.0",
|
|
41
41
|
"ts-results": "^3.3.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@chain-registry/types": "2.0.110",
|
|
45
44
|
"@testing-library/react-hooks": "^8.0.1",
|
|
46
45
|
"@types/react": "^18.0.25",
|
|
47
46
|
"@types/react-dom": "^18.0.25"
|
package/src/hub/autoConnect.ts
CHANGED
|
@@ -14,7 +14,6 @@ import type { WalletType } from '@rango-dev/wallets-shared';
|
|
|
14
14
|
|
|
15
15
|
import { Provider } from '@rango-dev/wallets-core';
|
|
16
16
|
import { legacyIsEvmNamespace } from '@rango-dev/wallets-core/legacy';
|
|
17
|
-
import { cosmosBlockchains } from 'rango-types';
|
|
18
17
|
import { Result } from 'ts-results';
|
|
19
18
|
|
|
20
19
|
import { HUB_LAST_CONNECTED_WALLETS } from '../legacy/mod.js';
|
|
@@ -23,7 +22,6 @@ import { runSequentiallyWithoutFailure } from './helpers.js';
|
|
|
23
22
|
import { LastConnectedWalletsFromStorage } from './lastConnectedWallets.js';
|
|
24
23
|
import {
|
|
25
24
|
convertNamespaceNetworkToEvmChainId,
|
|
26
|
-
isCosmosNamespace,
|
|
27
25
|
isEvmNamespace,
|
|
28
26
|
} from './utils.js';
|
|
29
27
|
|
|
@@ -86,20 +84,6 @@ async function eagerConnect(
|
|
|
86
84
|
>;
|
|
87
85
|
if (isEvmNamespace(namespace)) {
|
|
88
86
|
connectNamespacePromise = async () => namespace.connect(chain);
|
|
89
|
-
} else if (isCosmosNamespace(namespace)) {
|
|
90
|
-
const cosmosBlockChains = cosmosBlockchains(
|
|
91
|
-
params.allBlockChains || []
|
|
92
|
-
).filter((chain) => !!chain.chainId);
|
|
93
|
-
connectNamespacePromise = async () => {
|
|
94
|
-
return namespace.connect({
|
|
95
|
-
chainIds: cosmosBlockChains
|
|
96
|
-
.filter((chain) => chain.info && !chain.info.experimental)
|
|
97
|
-
?.map((chain) => chain.chainId!),
|
|
98
|
-
customChainIds: cosmosBlockChains
|
|
99
|
-
.filter((chain) => chain.info?.experimental)
|
|
100
|
-
.map((chain) => chain.chainId!),
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
87
|
} else {
|
|
104
88
|
connectNamespacePromise = async () => namespace.connect();
|
|
105
89
|
}
|
package/src/hub/helpers.ts
CHANGED
|
@@ -3,11 +3,9 @@ import type {
|
|
|
3
3
|
Accounts,
|
|
4
4
|
AccountsWithActiveChain,
|
|
5
5
|
} from '@rango-dev/wallets-core/namespaces/common';
|
|
6
|
-
import type { BlockchainMeta } from 'rango-types';
|
|
7
6
|
import type { Result } from 'ts-results';
|
|
8
7
|
|
|
9
8
|
import { legacyFormatAddressWithNetwork as formatAddressWithNetwork } from '@rango-dev/wallets-core/legacy';
|
|
10
|
-
import { CAIP_NAMESPACE as CAIP_COSMOS_NAMESPACE } from '@rango-dev/wallets-core/namespaces/cosmos';
|
|
11
9
|
import { CAIP_NAMESPACE as CAIP_TON_NAMESPACE } from '@rango-dev/wallets-core/namespaces/ton';
|
|
12
10
|
import { CAIP_TRON_CHAIN_ID } from '@rango-dev/wallets-core/namespaces/tron';
|
|
13
11
|
import {
|
|
@@ -15,12 +13,10 @@ import {
|
|
|
15
13
|
CAIP_ZCASH_CHAIN_ID,
|
|
16
14
|
} from '@rango-dev/wallets-core/namespaces/utxo';
|
|
17
15
|
import { CAIP } from '@rango-dev/wallets-core/utils';
|
|
18
|
-
import { getBlockChainNameFromId } from '@rango-dev/wallets-shared';
|
|
19
16
|
import { Err, Ok } from 'ts-results';
|
|
20
17
|
|
|
21
18
|
export function mapCaipNamespaceToLegacyNetworkName(
|
|
22
|
-
chainId: CAIP.ChainIdParams | string
|
|
23
|
-
allBlockChains: BlockchainMeta[]
|
|
19
|
+
chainId: CAIP.ChainIdParams | string
|
|
24
20
|
): string {
|
|
25
21
|
if (typeof chainId === 'string') {
|
|
26
22
|
return chainId;
|
|
@@ -42,15 +38,6 @@ export function mapCaipNamespaceToLegacyNetworkName(
|
|
|
42
38
|
if (chainId.namespace.toLowerCase() === CAIP_TON_NAMESPACE) {
|
|
43
39
|
return 'TON';
|
|
44
40
|
}
|
|
45
|
-
if (chainId.namespace.toLowerCase() === CAIP_COSMOS_NAMESPACE) {
|
|
46
|
-
const network = getBlockChainNameFromId(chainId.reference, allBlockChains);
|
|
47
|
-
if (!network) {
|
|
48
|
-
throw new Error(
|
|
49
|
-
`Network didn't found for given chainId: ${chainId.reference}`
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
return network;
|
|
53
|
-
}
|
|
54
41
|
if (chainId.namespace === 'sui' || chainId.reference === CAIP_TRON_CHAIN_ID) {
|
|
55
42
|
return chainId.reference.toUpperCase();
|
|
56
43
|
}
|
|
@@ -68,12 +55,9 @@ export function mapCaipNamespaceToLegacyNetworkName(
|
|
|
68
55
|
*
|
|
69
56
|
* @see https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-10.md
|
|
70
57
|
*/
|
|
71
|
-
export function fromAccountIdToLegacyAddressFormat(
|
|
72
|
-
account: string,
|
|
73
|
-
allBlockChains: BlockchainMeta[]
|
|
74
|
-
): string {
|
|
58
|
+
export function fromAccountIdToLegacyAddressFormat(account: string): string {
|
|
75
59
|
const { chainId, address } = CAIP.AccountId.parse(account);
|
|
76
|
-
const network = mapCaipNamespaceToLegacyNetworkName(chainId
|
|
60
|
+
const network = mapCaipNamespaceToLegacyNetworkName(chainId);
|
|
77
61
|
return formatAddressWithNetwork(address, network);
|
|
78
62
|
}
|
|
79
63
|
|
package/src/hub/useHubAdapter.ts
CHANGED
|
@@ -10,7 +10,6 @@ import type { VersionedProviders } from '@rango-dev/wallets-core/utils';
|
|
|
10
10
|
|
|
11
11
|
import { utils } from '@rango-dev/wallets-core/namespaces/evm';
|
|
12
12
|
import { type WalletInfo, type WalletType } from '@rango-dev/wallets-shared';
|
|
13
|
-
import { cosmosBlockchains } from 'rango-types';
|
|
14
13
|
import { useEffect, useRef, useState } from 'react';
|
|
15
14
|
import { Ok, Result } from 'ts-results';
|
|
16
15
|
|
|
@@ -22,13 +21,11 @@ import {
|
|
|
22
21
|
import { useAutoConnect } from '../legacy/useAutoConnect.js';
|
|
23
22
|
|
|
24
23
|
import { autoConnect } from './autoConnect.js';
|
|
25
|
-
import { convertCosmosMetaToChainRegistry } from './chainRegisteryConvertors.js';
|
|
26
24
|
import { createQueue, fromAccountIdToLegacyAddressFormat } from './helpers.js';
|
|
27
25
|
import { LastConnectedWalletsFromStorage } from './lastConnectedWallets.js';
|
|
28
26
|
import { useHubRefs } from './useHubRefs.js';
|
|
29
27
|
import {
|
|
30
28
|
getSupportedChainsFromProvider,
|
|
31
|
-
isCosmosNamespace,
|
|
32
29
|
isEvmNamespace,
|
|
33
30
|
isSolanaNamespace,
|
|
34
31
|
mapHubEventsToLegacy,
|
|
@@ -258,20 +255,6 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
|
|
|
258
255
|
namespace.connect(network, {
|
|
259
256
|
derivationPath: namespaceInput.derivationPath,
|
|
260
257
|
});
|
|
261
|
-
} else if (isCosmosNamespace(namespace)) {
|
|
262
|
-
const cosmosBlockChains = cosmosBlockchains(
|
|
263
|
-
params.allBlockChains || []
|
|
264
|
-
).filter((chain) => !!chain.chainId);
|
|
265
|
-
connectNamespacePromise = async () => {
|
|
266
|
-
return namespace.connect({
|
|
267
|
-
chainIds: cosmosBlockChains
|
|
268
|
-
.filter((chain) => chain.info && !chain.info.experimental)
|
|
269
|
-
?.map((chain) => chain.chainId!),
|
|
270
|
-
customChainIds: cosmosBlockChains
|
|
271
|
-
.filter((chain) => chain.info?.experimental)
|
|
272
|
-
.map((chain) => chain.chainId!),
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
258
|
} else {
|
|
276
259
|
connectNamespacePromise = async () => namespace.connect();
|
|
277
260
|
}
|
|
@@ -477,10 +460,7 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
|
|
|
477
460
|
.filter((namespace) => namespace.connected)
|
|
478
461
|
.flatMap((namespace) =>
|
|
479
462
|
namespace.accounts?.map((accounts) =>
|
|
480
|
-
fromAccountIdToLegacyAddressFormat(
|
|
481
|
-
accounts,
|
|
482
|
-
params.allBlockChains || []
|
|
483
|
-
)
|
|
463
|
+
fromAccountIdToLegacyAddressFormat(accounts)
|
|
484
464
|
)
|
|
485
465
|
)
|
|
486
466
|
.filter((account): account is string => !!account);
|
|
@@ -523,23 +503,6 @@ export function useHubAdapter(params: UseAdapterParams): ProviderContext {
|
|
|
523
503
|
if (!namespace.network) {
|
|
524
504
|
throw new Error('You should pass network to the suggest and connect');
|
|
525
505
|
}
|
|
526
|
-
if (isCosmosNamespace(proxiedNamespace)) {
|
|
527
|
-
const suggestedChainMeta = cosmosBlockchains(
|
|
528
|
-
params.allBlockChains || []
|
|
529
|
-
)
|
|
530
|
-
?.filter((chain) => chain.info && chain.info.experimental)
|
|
531
|
-
.find((chain) => chain.name === namespace.network);
|
|
532
|
-
if (!suggestedChainMeta) {
|
|
533
|
-
throw new Error(
|
|
534
|
-
`We couldn't find the suggested chain (${namespace.network}) in our metadata.`
|
|
535
|
-
);
|
|
536
|
-
}
|
|
537
|
-
const { assetList, chain } =
|
|
538
|
-
convertCosmosMetaToChainRegistry(suggestedChainMeta);
|
|
539
|
-
await proxiedNamespace.suggest(chain, assetList);
|
|
540
|
-
const [connectResult] = await this.connect(type, [namespace]);
|
|
541
|
-
return connectResult;
|
|
542
|
-
}
|
|
543
506
|
throw new Error(
|
|
544
507
|
`Suggest has not been implemented for given chain: ${namespace.network}`
|
|
545
508
|
);
|
package/src/hub/utils.ts
CHANGED
|
@@ -5,7 +5,6 @@ import type {
|
|
|
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
8
|
import type { EvmActions } from '@rango-dev/wallets-core/namespaces/evm';
|
|
10
9
|
import type { SolanaActions } from '@rango-dev/wallets-core/namespaces/solana';
|
|
11
10
|
import type { SuiActions } from '@rango-dev/wallets-core/namespaces/sui';
|
|
@@ -237,10 +236,7 @@ export function mapHubEventsToLegacy(
|
|
|
237
236
|
}
|
|
238
237
|
|
|
239
238
|
const formattedAddresses = event.accounts.map((accounts) =>
|
|
240
|
-
fromAccountIdToLegacyAddressFormat(
|
|
241
|
-
accounts,
|
|
242
|
-
metadata.allBlockChains || []
|
|
243
|
-
)
|
|
239
|
+
fromAccountIdToLegacyAddressFormat(accounts)
|
|
244
240
|
);
|
|
245
241
|
onUpdateState(
|
|
246
242
|
event.provider,
|
|
@@ -299,8 +295,6 @@ export function convertNamespaceNetworkToEvmChainId(
|
|
|
299
295
|
/**
|
|
300
296
|
* We are passing an string for chain id (e.g. ETH, POLYGON), but wallet's instances (e.g. window.ethereum) needs chainId (e.g. 0x1).
|
|
301
297
|
* This function will help us to map these strings to proper hex ids.
|
|
302
|
-
*
|
|
303
|
-
* If you need same functionality for other blockchain types (e.g. Cosmos), You can make a separate function and add it here.
|
|
304
298
|
*/
|
|
305
299
|
export function tryConvertNamespaceNetworkToChainInfo(
|
|
306
300
|
namespace: LegacyNamespaceInputForConnect,
|
|
@@ -371,23 +365,12 @@ export function synchronizeHubWithConfigProviders(
|
|
|
371
365
|
}
|
|
372
366
|
|
|
373
367
|
export function isSolanaNamespace(
|
|
374
|
-
ns: ProxiedNamespace<
|
|
375
|
-
EvmActions | SolanaActions | CosmosActions | SuiActions | UtxoActions
|
|
376
|
-
>
|
|
368
|
+
ns: ProxiedNamespace<EvmActions | SolanaActions | SuiActions | UtxoActions>
|
|
377
369
|
): ns is ProxiedNamespace<SolanaActions> & { namespaceId: 'Solana' } {
|
|
378
370
|
return ns.namespaceId === 'Solana';
|
|
379
371
|
}
|
|
380
372
|
export function isEvmNamespace(
|
|
381
|
-
ns: ProxiedNamespace<
|
|
382
|
-
EvmActions | SolanaActions | CosmosActions | SuiActions | UtxoActions
|
|
383
|
-
>
|
|
373
|
+
ns: ProxiedNamespace<EvmActions | SolanaActions | SuiActions | UtxoActions>
|
|
384
374
|
): ns is ProxiedNamespace<EvmActions> & { namespaceId: 'EVM' } {
|
|
385
375
|
return ns.namespaceId === 'EVM';
|
|
386
376
|
}
|
|
387
|
-
export function isCosmosNamespace(
|
|
388
|
-
ns: ProxiedNamespace<
|
|
389
|
-
EvmActions | SolanaActions | CosmosActions | SuiActions | UtxoActions
|
|
390
|
-
>
|
|
391
|
-
): ns is ProxiedNamespace<CosmosActions> & { namespaceId: 'Cosmos' } {
|
|
392
|
-
return ns.namespaceId === 'Cosmos';
|
|
393
|
-
}
|
|
@@ -161,82 +161,4 @@ export const blockchainsMeta: BlockchainMeta[] = [
|
|
|
161
161
|
tokenUrl: 'https://solscan.io/token/{address}',
|
|
162
162
|
},
|
|
163
163
|
},
|
|
164
|
-
{
|
|
165
|
-
name: 'COSMOS',
|
|
166
|
-
defaultDecimals: 6,
|
|
167
|
-
addressPatterns: ['^(cosmos1)[0-9a-z]{38}$'],
|
|
168
|
-
feeAssets: [
|
|
169
|
-
{
|
|
170
|
-
blockchain: 'COSMOS',
|
|
171
|
-
symbol: 'ATOM',
|
|
172
|
-
address: null,
|
|
173
|
-
},
|
|
174
|
-
],
|
|
175
|
-
logo: 'https://raw.githubusercontent.com/rango-exchange/assets/main/blockchains/COSMOS/icon.svg',
|
|
176
|
-
displayName: 'Cosmos',
|
|
177
|
-
shortName: 'Cosmos',
|
|
178
|
-
sort: 15,
|
|
179
|
-
color: '#2E3148',
|
|
180
|
-
enabled: true,
|
|
181
|
-
type: TransactionType.COSMOS,
|
|
182
|
-
chainId: 'cosmoshub-4',
|
|
183
|
-
info: {
|
|
184
|
-
infoType: 'CosmosMetaInfo',
|
|
185
|
-
experimental: false,
|
|
186
|
-
rpc: 'https://cosmos-rpc.polkachu.com',
|
|
187
|
-
rest: 'https://lcd-cosmoshub.blockapsis.com',
|
|
188
|
-
cosmostationLcdUrl: 'https://lcd-cosmoshub.blockapsis.com',
|
|
189
|
-
cosmostationApiUrl: 'https://cosmos-rpc.polkachu.com',
|
|
190
|
-
cosmostationDenomTracePath: '/ibc/apps/transfer/v1/denom_traces/',
|
|
191
|
-
mintScanName: 'cosmos',
|
|
192
|
-
chainName: 'Cosmos',
|
|
193
|
-
stakeCurrency: {
|
|
194
|
-
coinDenom: 'ATOM',
|
|
195
|
-
coinMinimalDenom: 'uatom',
|
|
196
|
-
coinDecimals: 6,
|
|
197
|
-
coinGeckoId: 'cosmos',
|
|
198
|
-
coinImageUrl: '/tokens/blockchain/cosmos.svg',
|
|
199
|
-
},
|
|
200
|
-
bip44: {
|
|
201
|
-
coinType: 118,
|
|
202
|
-
},
|
|
203
|
-
bech32Config: {
|
|
204
|
-
bech32PrefixAccAddr: 'cosmos',
|
|
205
|
-
bech32PrefixAccPub: 'cosmospub',
|
|
206
|
-
bech32PrefixValAddr: 'cosmosvaloper',
|
|
207
|
-
bech32PrefixValPub: 'cosmosvaloperpub',
|
|
208
|
-
bech32PrefixConsAddr: 'cosmosvalcons',
|
|
209
|
-
bech32PrefixConsPub: 'cosmosvalconspub',
|
|
210
|
-
},
|
|
211
|
-
currencies: [
|
|
212
|
-
{
|
|
213
|
-
coinDenom: 'ATOM',
|
|
214
|
-
coinMinimalDenom: 'uatom',
|
|
215
|
-
coinDecimals: 6,
|
|
216
|
-
coinGeckoId: 'cosmos',
|
|
217
|
-
coinImageUrl: '/tokens/blockchain/cosmos.svg',
|
|
218
|
-
},
|
|
219
|
-
],
|
|
220
|
-
feeCurrencies: [
|
|
221
|
-
{
|
|
222
|
-
coinDenom: 'ATOM',
|
|
223
|
-
coinMinimalDenom: 'uatom',
|
|
224
|
-
coinDecimals: 6,
|
|
225
|
-
coinGeckoId: 'cosmos',
|
|
226
|
-
coinImageUrl: '/tokens/blockchain/cosmos.svg',
|
|
227
|
-
},
|
|
228
|
-
],
|
|
229
|
-
features: ['stargate', 'ibc-transfer'],
|
|
230
|
-
explorerUrlToTx: 'https://www.mintscan.io/cosmos/txs/{txHash}',
|
|
231
|
-
gasPriceStep: {
|
|
232
|
-
low: 0.01,
|
|
233
|
-
average: 0.025,
|
|
234
|
-
high: 0.04,
|
|
235
|
-
},
|
|
236
|
-
blockExplorerUrls: ['https://www.mintscan.io/cosmos/'],
|
|
237
|
-
addressUrl: 'https://www.mintscan.io/cosmos/account/{wallet}',
|
|
238
|
-
transactionUrl: 'https://www.mintscan.io/cosmos/txs/{txHash}',
|
|
239
|
-
tokenUrl: 'https://www.mintscan.io/cosmos/assets/{address}',
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
164
|
];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CosmosAssetList, CosmosChain } from '@rango-dev/wallets-core/namespaces/cosmos';
|
|
2
|
-
import type { CosmosBlockchainMeta } from 'rango-types';
|
|
3
|
-
export interface ConversionResult {
|
|
4
|
-
chain: CosmosChain;
|
|
5
|
-
assetList: CosmosAssetList;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Converts CosmosBlockchainMeta to Chain and AssetList formats
|
|
9
|
-
*/
|
|
10
|
-
export declare function convertCosmosMetaToChainRegistry(meta: CosmosBlockchainMeta): ConversionResult;
|
|
11
|
-
//# sourceMappingURL=chainRegisteryConvertors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chainRegisteryConvertors.d.ts","sourceRoot":"","sources":["../../src/hub/chainRegisteryConvertors.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACZ,MAAM,2CAA2C,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAmB,MAAM,aAAa,CAAC;AAEzE,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,eAAe,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,oBAAoB,GACzB,gBAAgB,CAWlB"}
|