A wallet connector for the Cosmos ⚛️

Overview

cosmos-kit

A wallet adapter for react with mobile WalletConnect support for the Cosmos ecosystem.

Getting Started

@cosmos-kit/react

A wallet adapter for react with mobile WalletConnect support for the Cosmos ecosystem.

@cosmos-kit/example

An example Next.js project integrating @cosmos-kit/react wallet adapter.

Developing

Checkout the repository and bootstrap the yarn workspace:

# Clone the repo.
git clone https://github.com/cosmology-tech/cosmos-kit
cd cosmos-kit
yarn
yarn bootstrap

Building

yarn build

Publishing

lerna publish
# lerna publish minor
# lerna publish major

Credits

Original work inspired by cosmodal.

Comments
  • styles are being overridden

    styles are being overridden

    tailwind styles overridden

    since it has been indicated that tailwind styles don't break when using 0.24.7, seems that the commit after this one: https://github.com/cosmology-tech/cosmos-kit/commit/02ba6b02c2bb4fa4f32edf5574a5e50a755b30e8

    which is this one: https://github.com/cosmology-tech/cosmos-kit/commit/3afd3e868ae7533dc6072e74b1732bd25ee5be7c

    could likely be the reason why styles are being overridden

    Screen Shot 2022-11-22 at 9 44 21 PM

    bug 
    opened by pyramation 6
  • Integrate Wallet State Machine

    Integrate Wallet State Machine

    Okay guys here it goes, we're integrating xstate and turning the side effects to a first class citizen.

    • [x] Make the UI work with Wallet connect and Wallet Extension;
    • [x] Polish the states to make them work on mobile; Right now it does deep link you to the app but it probably won't fully connect a mobile wallet from safari iOS. Plus reset action is not there just yet.
    • [ ] Rethink context utils and config props;
    • [ ] Clean up the UI & the context;
    • [ ] Better dev scripts.
    • [ ] Tests.
    opened by nikitatrifan 4
  • Global package versioning

    Global package versioning

    It'd be awesome if all the packages in this monorepo were versioned and published at the same time, so users can just consume one version (ie. 0.27.5) instead of having to manually check each dependency to ensure we're on the latest.

    See the cosmos-kit example project for how projects will look with different versions of everything. A little messy

    opened by 0xArbi 3
  • Keplr ledger extension having issues signing contract execution msgs

    Keplr ledger extension having issues signing contract execution msgs

    This is the error users are experiencing:

    image

    It looks like one has to do a bit of special handling when using keplr, ledger live devices

    Related Issue: https://github.com/BitCannaGlobal/web-wallet/issues/4

    opened by professionallyatortoise 3
  • when using default modal Chakra theme being overwritten

    when using default modal Chakra theme being overwritten

    I just updated to the latest version of cosmos-kit and found out, that your ChakraProvider used in the modal overrides my custom theme entirely. I even replaced the modal with a custom one and it still overrides my entire chakra config. Any ideas?

    opened by vexxvakan 3
  • Type errors

    Type errors

    I'm running into the following type errors

    Type error: Could not find a declaration file for module '@cosmos-kit/core'. '/0xArb/proposals-interface/node_modules/@cosmos-kit/core/main/index.js' implicitly has an 'any' type.
      Try `npm i --save-dev @types/cosmos-kit__core` if it exists or add a new declaration (.d.ts) file containing `declare module '@cosmos-kit/core';`
    

    My versions are as follows

        "@cosmos-kit/core": "0.27.10",
        "@cosmos-kit/keplr": "0.32.11",
        "@cosmos-kit/react": "0.27.5",
    
    opened by 0xArbi 2
  • Chakra theme on default modals breaks existing chakra theme

    Chakra theme on default modals breaks existing chakra theme

    Existing apps that uses Chakra UI will encounter an issue where the base theme will be overridden with cosmos-kit's default modal because it wraps its own ChakraProvider.

    Having the option to disable provider wrapping or provide an escape hatch to pass custom themes would be better.

    https://github.com/cosmology-tech/cosmos-kit/blob/8eff22dcdc01fae2eacae57d26952892a50232d3/packages/react/src/modal/get-modal.tsx#L48-L60

    opened by grikomsn 2
  • use `chain-registry` for chain info

    use `chain-registry` for chain info

    let's look into using chain-registry to make this type of thing

    https://github.com/cosmology-tech/cosmos-wallet/blob/2e66939d241f06516673598f035dbaa00ed6e828/packages/core/src/chainInfo.ts

    oh, actually... @NoahSaso I just got an idea if we should parse JSON and generate objects, or if I should look into using ASTs + codegen haha

    https://github.com/cosmology-tech/chain-registry and https://www.npmjs.com/package/chain-registry

    opened by pyramation 2
  • getOfflineSignerAuto

    getOfflineSignerAuto

    I haven't tested this, because I found it quite hard to yarn link all the cosmos-kit packages locally, but I believe it resolves https://github.com/cosmology-tech/cosmos-kit/issues/99.

    What happens is that getOfflineSigner in Keplr defaults to returning a wallet that supports Amino and Direct signing. This is obviously false in the case of Ledger devices and is leading to some of the errors we've been seeing.

    opened by 0xArbi 1
  • Leap after 10mins idle show spinning loaders upon chain change

    Leap after 10mins idle show spinning loaders upon chain change

    1. connect wallet
    2. let sit for 10 mins
    3. change the chain
    4. without refreshing, change chains and wallets

    You should see Keplr will work, Leap seems to just show spinning loaders.

    bug 
    opened by pyramation 1
  • abstract wallet class methods for broadcast and signing messages

    abstract wallet class methods for broadcast and signing messages

    some wallets, like trust, want to manage their own endpoints. We should provide a way for them to broadcast the messages after we sign w the provider offlineSigner.

    https://github.com/trustwallet/trust-web3-provider/blob/12b20e3fd995394e456f6b7fa0b5d37e7d381ea8/src/cosmos_provider.js#L95-L104

    https://github.com/trustwallet/trust-web3-provider/blob/master/src/cosmjs_adapter.js

    you can request offline signer from window.trustwallet https://github.com/trustwallet/trust-web3-provider/blob/12b20e3fd995394e456f6b7fa0b5d37e7d381ea8/src/cosmos_provider.js#L48-L58

    opened by pyramation 1
  • Split keplr mobile / extension to separate deps

    Split keplr mobile / extension to separate deps

    I know this might sound controversial, but I actually want to be able to import keplr mobile/extension separately because wallet connect brings in a ton of stuff that has awful commonjs modules that need pre-transpiling for non-react/next projects. I also don't necessarily want a WS ping/ack added for simply adding a keplr query provider.

    See this line specifically: https://github.com/cosmology-tech/cosmos-kit/blob/main/packages/keplr/src/keplr.ts#L9

    SO! I am proposing that they get split into 2 packages, so it can be independently added. I realize this is a breaking change for some projects, but I believe for future work, this pattern of context splitting for any provider (cosmostation, leap, you name it) is necessary for more granular inclusion.

    Thoughts? If there's a way to disable keplr wallet already - would love to know :)

    opened by TrevorJTClarke 1
  • ICNS integration

    ICNS integration

    Add ICNS integration for cosmos-kit. This PR contains

    • @cosmos-kit/icns as a separated package
    • icns hooks in react package, let me know if it makes more sense to separate the hook logic out as it's own package (eg. @cosmos-kit/icns-react) or moved to @cosmos-kit/icns

    The goal is to make it modular and not imposed itself as a default name service so developer can choose what they want.

    opened by iboss-ptk 1
  • Resolve Stargaze Names

    Resolve Stargaze Names

    Overview

    Basic attempt at rendering a .stars domain in place of a users "wallet username" if they have one.

    Notes

    • IMO it's pretty uncommon that wallets actually expose a "username" to dapps. MetaMask, WalletConnect, etc all do not support this, seems to be a Keplr implementation detail
    • This approach is nice because consumers don't have to change anything to start having this data come through. Another way would be introducing another field on the cosmos-kit API like stargazeName so consumers can do stargazeName ?? username
    • Next step would be to bubble up the image associated with the name NFT, if the user has set one
    opened by 0xArbi 4
  • allow usage of `HttpEndpoint` for urls

    allow usage of `HttpEndpoint` for urls

    Telescope and CosmJS support HttpEndpoint which allows users to pass headers into requests, cosmos-kit should support this. Perhaps we just need to make a modified version of chain-registry/types to allow for this

    https://github.com/osmosis-labs/osmojs/blob/843b315fa0bc304eebc7664c152c18cc1871792c/packages/osmojs/src/codegen/osmosis/rpc.query.ts#L6

    export interface HttpEndpoint {
      /**
       * The URL of the HTTP endpoint.
       *
       * For POST APIs like Tendermint RPC in CosmJS,
       * this is without the method specific paths (e.g. https://cosmoshub-4--rpc--full.datahub.figment.io/)
       */
      readonly url: string;
      /**
       * HTTP headers that are sent with every request, such as authorization information.
       */
      readonly headers: Record<string, string>;
    }
    
    opened by pyramation 0
  • brave browser loaded w extensions, ad blockers, produces errors

    brave browser loaded w extensions, ad blockers, produces errors

    environment

    brave browser (loaded with extensions, ad blockers, etc)

    Seems that somehow the detection for whether or not we're mobile was triggering, even though the user agent was still chrome!

    issue

    errors happen with connecting

    Screen Shot 2022-12-16 at 2 53 21 PM

    Screen Shot 2022-12-16 at 3 01 18 PM

    steps to reproduce

    1. create template
    create-cosmos-app --name cnfts-frontend --example --template cosmwasm
    
    1. attempt to connect wallet

    However, it looks that the browser was somehow choosing the keplr mobile — so this is maybe why the offlineSigner was undefined... but why was it 1. using mobile and 2. trying get get a signer before actually connecting?

    idea to debug

    Perhaps we should test using keplr mobile as the chosen wallet inside of chrome and see what happens

    important note

    as soon as developer removed all extensions by creating fresh profile only with keplr extension, everything worked fine

    opened by pyramation 0
  • [react] context and providers

    [react] context and providers

    related

    • [ ] https://github.com/CosmWasm/ts-codegen/issues/77
    • [ ] https://github.com/CosmWasm/ts-codegen/issues/84
    • [ ] https://github.com/osmosis-labs/telescope/issues/276
    opened by pyramation 0
Owner
Cosmology
Cosmology
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Nami Wallet is a browser based wallet extension to interact with the Cardano blockchain.

Nami Wallet Nami Wallet is a browser based wallet extension to interact with the Cardano blockchain. It's an open-source project and built by Berry Po

Berry 335 Dec 29, 2022
A simple CLI Tools to Empty Crypto Wallet & Send to your other Wallet Address

A simple CLI tools to empty crypto wallet & send to your other wallet, Build with Nodejs using Ethers API Run Locally Clone the project git clone ht

Raihan Ramadhani 11 Dec 29, 2022
JavaScript Express.js app serving static vanilla JS. This sample app is used in Microsoft Docs to demonstrate how to integrate Azure Storage, Azure Cosmos DB, and Azure Active Directory.

JavaScript on Azure Learn Path - Module 2 - Deploying a basic app to Azure This Learn module requires the following Azure resources to deploy correctl

Azure Samples 13 Dec 31, 2022
🪐 Ultralight Cosmos utilities for JS and TS

Essential Cosmos Ultralight Cosmos utilities for JS and TS ?? The TINIEST code size possible ʦ Fully typed with TypeScript (also works with JavaScript

Earnifi 7 Oct 24, 2022
Auto-compounder app for Cosmos blockchains using Authz

REStake REStake allows delegators to grant permission for a validator to compound their rewards, and provides a script validators can run to find thei

ECO Stake 237 Dec 29, 2022
A TypeScript Transpiler for Cosmos Protobufs ⚛️

Telescope ?? Babel for the Cosmos A TypeScript Transpiler for Cosmos Protobufs Quickstart Follow the instructions below to kick off your Telescope mod

null 84 Dec 15, 2022
Nepkit Connector – Build Dashboards & Admin Tools in minutes

Nepkit Connector Use Nepkit Connector to connect Nepkit Dashboard Builder to the database on your server or local machine. Supported databases: Postgr

Nepkit 3 Jun 3, 2022
Cosmos chain registry ⚛️

chain-registry The npm package for the Official Cosmos chain registry npm install chain-registry example import { assets, chains, ibc } from 'chain-r

Cosmology 19 Dec 8, 2022
Socket IO Connector for Yjs (Inspired by y-websocket)

Welcome to y-socket.io ?? Socket IO Connector for Yjs (Inspired by y-websocket) Y-socket.io is a YJS document synchronization implementation over the

Iván Topp Sandoval 18 Dec 21, 2022
Védettségi igazolvány Apple Wallet-ben

Védettségi igazolvány Apple Wallet-ben Egyszerű webes alkalmazás, amivel a védettségi igazolványt lehet az Apple Wallet-be berakni. A QR kód ugyanúgy

Peter Viszt 23 Jun 21, 2022
Electrum Wallet for Nazicoin.

Nazicoin Electron Wallet Repo to latest version of nazicoin-electron-wallet Pre-requisites Download latest daemon nazicoind Commands nvm use 11.9.0 np

null 2 Dec 20, 2021
Generate random ethereum wallets & private keys and then check if they match a wallet that contains some kind of balance, so that you can take it. In Node.js

Ethereum-Stealer Generate random ethereum wallets & private keys and then check if they match a wallet that contains some kind of balance, so that you

Michał 74 Dec 24, 2022
Fast, secure and modern wallet for TONCOIN

Tonhub Wallet (alpha version) New user friendly wallet for TONCOIN written in Typescript and React Native built for fast development and security in m

Tonwhales 42 Dec 26, 2022
This shows NFT tracking in the certain wallet using express back-end.

nft-tracking-for-solana-wallet Express backend for NFT tracking in the certain wallet. Webhook for scraping secondary marketplace information for part

null 10 Nov 16, 2022
Re-uploading Trybe Wallet

?? Welcome to Trybe Wallet! Trybe Wallet is a project I did at Trybe, which is a programing school. In order to test my knowledge of Redux, I also lea

Nicole Calderari 4 Apr 12, 2022
The frontend of a full stack application of a personal wallet made with React, Node and MongoDB that allows you to add inputs, outputs and see all your extract.

The frontend of a full stack application of a personal wallet made with React, Node and MongoDB that allows you to add inputs, outputs and see all your extract.

Bernardo Rodrigues 5 Jun 2, 2022