Giter Club home page Giter Club logo

cosmos-multisig-ui's People

Contributors

abefernan avatar klk1236 avatar msteiner96 avatar nooomski avatar okwme avatar omahs avatar samepant avatar webmaster128 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cosmos-multisig-ui's Issues

Add navigation

There are a few pages where there's no navigation:

  • In progress transaction -> should be able to go back to multisig view
  • Multisig view -> can't go back to main page
  • Create multisig -> can't go back to main page

Just a "go back to x" button at the top should do it.

Forms get cleared when modifying tx

When modifying tx related data fields, like adding or deleting msgs, or inputting memo, the msgs forms get cleared. Probably has to do with keyprop.

Multisig holdings are always listed as ATOM

We should list the chain native token, which you can just get from querying the balance.

If a multisig somehow has multiple holdings, it would be great to display those as well, but that's a nice to have imo.

Use the first asset instead of erroring when there are multiple

In this code we create an error when there are multiple assets:

      if (assetData.assets.length > 1) {
        denom = "";
        displayDenom = "";
        gasPrice = "";
        displayDenomExponent = 0;

        setChainError("Multiple token denoms available, enter manually");
        setShowSettings(true);
      } else {
        const asset: ChainRegistryAsset = assetData.assets[0];
        denom = asset.base;
        displayDenom = asset.symbol;
        gasPrice = `0.03${asset.base}`;
        const displayUnit = asset.denom_units.find((u) => u.denom == asset.display);
        displayDenomExponent = displayUnit?.exponent ?? 6;
      }

Bildschirm­foto 2023-04-12 um 13 14 40

However, in cases like Osmosis this is very inconvenient. Most of the time you just one the first one (OSMO). It would be good to remove the error. The user can always override the values if they want a different asset.

Add support for staking transactions

Gotten some feedback from potential users that staking would be great to implement as well. So, together with other open issues, it looks like ideally there would be several actions that one could do with a multisig:

  • Send tokens
  • Staking (Claim, Delegate, Undelegate, Redelegate)
  • Create vesting account #49
  • Create authorization (pending ledger support)

So I'm wondering if perhaps we should just have the available actions listed, and once clicked, a new form pops up with the inputs that that Msg takes.

Give feedback to user after pressing a button

There's no direct feedback after pressing a button to create a multisig or transaction, but it can take a while before the next page loads. Could we get a simple loading icon in or around the button or something like that?

Display list of user's multisigs & transactions

On the main landing page, it would be great to see a list of multisigs that you have created that are stored in the DB.
On the specific multisig page, seeing a list of transactions that have been created or have been completed could be useful as well.

Imo, the transactions should probably only be visible if you are a member of the multisig.

This will only work for multisigs and transactions created through this app, as there is no way to query for them on-chain afaik.

Unclear how to share signing link

Right now the user sees this when a transaction was composed and sigened:

Screenshot 2022-01-28 at 15 34 36

At this point it is unclear what needs to be done in order to let other users sign. Also it does not work great if the transaction composer is not in the signer set.

In order to clarify this in the UI, I propose the following screens:

  1. Compose transaction
  2. Confirm of compose, show signing link in UI. Composer can copy link or sign if in the signer set.
  3. Signing screen

Raise error if user is not part of the multisig

Right now I can sign a transaction for a multisig that I am not part of. It even shows "1 of 2 signatures complete" in that case. This is not dangerous because my signature is just worthless. However, it would be nice to tell the user earlier to avoid a hard to debug signature verification failure later on.

This case can happen easily if a user has multiple accounts.

Bildschirmfoto 2022-01-10 um 16 34 50

Add interface type to chainData and assetData

For the raw HTTP requests

      const chainInfoUrl =
        "https://cdn.jsdelivr.net/gh/cosmos/chain-registry@master/" +
        chainOption.path +
        "/chain.json";
      const chainAssetUrl =
        "https://cdn.jsdelivr.net/gh/cosmos/chain-registry@master/" +
        chainOption.path +
        "/assetlist.json";

      const { data: chainData } = await axios.get(chainInfoUrl);
      const { data: assetData } = await axios.get(chainAssetUrl);

we should get interfaces to ensure we have type safety accessing the data.

This is already started in components/chainSelect/chainregistry.ts but should be reviewed and used to the above cases. We don't need all fields but the ones we use should be typed.

Better input for MsgTransfer timeout

The current input looks like this:

Bildschirmfoto 2023-06-13 um 16 05 38

This is cool and it works. It has a few flaw such as clearing the field every time you click in it.

I wonder if we find a better UI component for a list of existing options or a custom input. We could also go with something like a radio button that has the pre-defined options as well as a "Custom" option that comes with an input field.

Support for various common message types

  • Bank
    • Send
  • Staking
    • Delegate (fixed in #89)
    • Claim rewards, Undelegate, Redelegate (#95)
    • Set Withdraw address (#123)
  • Vesting
    • Create vesting accounts (#126)
  • IBC
    • MsgTransfer (#127)
  • Governance
    • MsgVote
  • CosmWasm (#158)
    • Execute
    • Instantiate/Instantiate2
    • Migrate
  • Create authorization (CosmJS/Ledger support ready?)

Show error to the user when Keplr is missing

The "enable err:" in

  connectWallet = async () => {
    try {
      await window.keplr.enable(process.env.NEXT_PUBLIC_CHAIN_ID);
      const walletAccount = await window.keplr.getKey(
        process.env.NEXT_PUBLIC_CHAIN_ID
      );
      const hasSigned = this.props.signatures.some(
        (sig) => sig.address === walletAccount.bech32Address
      );
      this.setState({ walletAccount, hasSigned });
    } catch (e) {
      console.log("enable err: ", e);
    }
  };

happens when Keplr is not installed. It would be nice to propagate that error to the user.

Iterate between available endpoints if RPC node is not available

Using Comdex as an example, the console printed an error that the the node was not available. I would suggest putting all RPC endpoints in an array, catching any error, and iterating over the list until there is a successful connection.

On failure at end of array, inform the user that none of the listed RPC endpoints are, available instead of the generic "failed to fetch" message.

Add support for multiple messages per transaction

We'll need this for claiming rewards from multiple validators in one tx but also allowing multiple sends would be nice.

  • Organize UI to differentiate between message and transaction (#97)
  • Allow creating multiple messages of the same type in the form
  • Allow a mixed list of messages
  • Automatically caclulate a reasonable gas limit for multi message transactions

Support for arbitrary message types

Right now the app only supports signing messages for sending tokens. It would be great if multisigs could create and sign any message type (even uploading or pasting in JSON).

I'm a little unclear as to whether this would mean adding support for protobuf message types, or if the Amino signer can handle any message type.

@webmaster128 Any ideas?

Feature: Import existing transaction

As of now, it's possible to create new transactions. Besides that we should add a button "Import Transaction" which let's the user importing the JSON String of an existing transaction. Otherwise it's only possible to sign simple transfers.

E.g. in JUNO they need more advanced transactions to delegate stuff etc.

A simple textbox to import pre-formatted JSON should be enough.

Error: Invalid delegation amount error when broadcasting transaction

gm, we're running into the following error whenever we try to broadcast a transaction:
Error: Broadcasting transaction failed with code 18 (codespace: sdk). Log: invalid delegation amount: invalid request

example signed transactions that experience this error when broadcasting:
#1
#2

The last multisig transaction that we were successfully able to execute (also a delegation tx) was on April 18th, and then both signers (ledgers) started experiencing this error.

Setup linter

At the moment there is no tooling for linting and code formatting, right?

Yesterday I tried to setup eslint + prettier, which is a combination I'm very happy with for other projects. It was not easy to configure due to JSX/React and a bunch of other things. Also there are some unmaintained files in the folder that probably should be excluded.

Before I invest more work in this, I'd like to check if this is something we want here and if eslint is fine for you? This setup can easily be extended by a TypeScript plugin, such that we are prepared for a TS migration.

Switching chains while viewing a multisig should direct to main page

When you are viewing a multisig address from chain A and switch to chain B, the multisig address listed is still from chain A, while the addresses listed are from chain B. An error is produced:

This multisig address's pubkeys are not available, and so it cannot be used with this tool.

You can recreate it with this tool here, or sign and broadcast a transaction with the tool you used to create it. Either option will make the pubkeys accessible and will allow this tool to use this multisig fully.

I suggest we just redirect to the landing page when a user selects a new chain on any page (like viewing a transaction as well for example).

Add LICENSE

This repository is missing a LICENSE. Given that it has been developed for the Interchain Foundation in the past, I assume Apache 2 is the appropriate choice. At least from Confio's perfective it is.

I'd like to ask the contributors of this repo to confirm they are happy with that

Run lint in CI

We have a lint command (npm run lint) but it is not part of CI checks. Would be good to get this into some GitHub Actions or CircleCI config.

Add support for IBC transfers

The message looks like this:

export interface MsgTransfer {
  /** the port on which the packet will be sent */
  sourcePort: string;
  /** the channel by which the packet will be sent */
  sourceChannel: string;
  /** the tokens to be transferred */
  token?: Coin;
  /** the sender address */
  sender: string;
  /** the recipient address on the destination chain */
  receiver: string;
  /**
   * Timeout height relative to the current block height.
   * The timeout is disabled when set to 0.
   */
  timeoutHeight?: Height;
  /**
   * Timeout timestamp in absolute nanoseconds since unix epoch.
   * The timeout is disabled when set to 0.
   */
  timeoutTimestamp: Long;
  /** optional memo */
  memo: string;
}

Some notes here:

  • sourcePort should be pre-set to "transfer" by default, but can be changed by the user
  • token is required and an aribrary numeric amount and arbitrary string denom (only one, no list here)
  • We can use timeoutTimestamp only and put a date in the future. timeoutHeight can be set to undefined. Ideally we offer the user simple options like 12 hours from now, 1 day from now, 2 days from now, 3 days from now, 7 days from now, 10 days from now, 2 weeks from now, 3 weeks from now, 1 month from now, custom time
  • The memo in the message is a different memo than the transaction memo. Both can be set individually.

Hard to debug error case: multisig account has no accountNumber

The multisig account needs an account number on chain at compose time as shown in this example: https://github.com/cosmos/cosmjs/blob/v0.27.0/packages/stargate/src/multisignature.spec.ts#L177-L207

Now if I create a transaction for a newly created multisig address, there will be no account number and

    if (!accountOnChain) {
      accountOnChain = {};
    }
    accountOnChain.pubkey = pubkey;

will be used from now on. However, due to the missing accountNumber, signing will fail later on with some hard to debug error message:

Error creating signature: TypeError: Cannot read properties of undefined (reading 'toString') at makeSignDoc (signdoc.js?0bac:31:1)

I think it would make sense to not allow composing a transaction without an accountNumber.

Show transaction hash in UI directly

When a transaction is broadcasted, it would be nice to have the transaction hash easily available in the UI.
Right now only a Mintscan Cosmos Hub link is available (that fortunately contains the hash). With the hash in the UI it is easier to use it in other tools.

Bildschirmfoto 2022-01-11 um 15 24 14

Add support for create-vesting-account

Would be cool if there was an option to create a vesting account. A few things to consider:

  • To create a vesting account, the address needs to not have been initialised on-chain already (i.e. never received a balance)
  • To create a vesting account, some tokens need to be transferred in that create-vesting-account Tx
  • There are two ways to do vesting:
    • Delayed vesting: all tokens unlock at once at a specified time (the most common usage)
    • Continuous: all tokens unlock continuously until a specific time
  • The spec seems to be out of date, as it is currently possible to create new vesting accounts (just tested it on theta testnet)

This is primarily aimed at funding organisations like the ICF.

If you'd like you can experiment with this on CLI on the Theta testnet using 'gaiad tx vesting create-vesting-account [receiving address] [amount] [unix epoch time] --chain-id theta-testnet-001 --node http://rpc.sentry-01.theta-testnet.polypore.xyz:26657 --from [sending key] --delayed`. Please ping me if you need testnet tokens.

UX: only accepting compressed Secp256k1 pubkey

I've been trying to test this tool out, but was unable to without putting some effort into converting my address to compressed Secp256k1.

In order to provide a smooth user experience for users on all expertise levels, it would be great if this tool would accept addresses as directly copied from wallets like Keplr. Are you able to implement a check, so that the tool auto-detects the pubkey type and converts where necessary?

Tool fails silently when clicking Connect Ledger but Cosmos app is not open

On the tx signing screen when you click "Connect Ledger (WebUSB)" and the Ledger is connected but the Cosmos app is not open, there is an error

Uncaught (in promise) Error: Please close BOLOS and open the Cosmos Ledger app on your Ledger device.

But this is not shown to the user. Instead nothing happens.

Create generic tx form with swapable message components

Right now the app assumes there is only 1 message per transaction and has one transaction form per message type. However, this creates a lot of duplication. Also it makes adding new message types harder than necessary.

It would be good to make a standard transaction form where you just pass the message type as an argument. Then each message type has its own form component for the input.

Some data (especially memo) can then more from the message form to the transaction form where it belongs.

Query gas price from chain registry

We currently hardcode the gas price 0.03${firstAsset.base} which is often not what you want. However, in many cases the gas price is available in the chain registry.

Support signing with Ledger directly

It would be nice if the user could choose between signing with Keplr and signing with Ledger (via WebUSB). This has been developed and is tested in other places. It's just a matter of integrating it in the app.

Why is this relevant?

  • choice
  • more flexible use of different bowsers or user profiles
  • easier for chains that are not yet integrated in Keplr

Bug: Account or sequence error when broadcasting transaction

Trying to broadcast this Tx and getting the following error:

Broadcasting transaction failed with code 4 (codespace: sdk). Log: signature verification failed; please verify account number (1126996), sequence (0) and chain-id (cosmoshub-4): unauthorized

I can't tell for sure, but I believe this is from a multisig that I've used before and have submitted a tx for in the past, or even have unsubmitted txs in the DB somewhere. I'm guessing something is going wrong with the sequence number there.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.