Skip to content

[Task] Check that recipient is valid before sending transaction #581

@frolvanya

Description

@frolvanya

Background

It would be nice to add a check that recipient is valid before sending transaction. It could be done in two ways:

  1. Making an rpc call to check that recipient exists on-chain and ask something like "The provided recipient <account-id> does not exist on <network>, are you sure that you want to proceed? (y/n)"

This option can be more robust, but it'll make life a bit harder for those who want to send tokens to new account that wasn't activated yet

  1. By raw parent account check and making sure that "testnet" is not parent if mainnet network is selected and vice versa for testnet network

I think one this is simpler and doesn't require extra rpc call

User Story

As a user I want to have minimal chances of submitting a transaction to a recipient on different network or non-existent recipient at all, but I still want to be able to do it after explicit confirmation, I shouldn't be blocked by this

Acceptance Criteria

I think this can be added only for tokens subcommand for now, since contract should be safe (call will immediately fail if recipient is invalid)

Resources & Additional Notes

This is needed to prevent such issues https://nearblocks.io/txns/4SeBJbjHxkEmtbwB1T7FLxBHzkgGCg3HmqCcbQoatL2Q

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    NEW❗

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions