Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] allow read only mode #1

Open
SvenMeyer opened this issue Feb 11, 2023 · 4 comments
Open

[Feature] allow read only mode #1

SvenMeyer opened this issue Feb 11, 2023 · 4 comments

Comments

@SvenMeyer
Copy link

(To start with), I would like to use the CLI in read-only mode to get a list of my open positions.
However, changing the private key to a real one is needed to setup the config

$ perp position -t 0x3aFxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Creating New Config File
Would you like to change your RPC URL? (y/n)
y
Please provide an RPC URL:
https://endpoints.omniatech.io/v1/op/mainnet/d33exxxxxxxxxxxxxxxxxxxxxxx
New RPC URL has been validated and works. Saving to config file now...
Your Chain ID is set to: 10
Would you like to change your Chain ID? (y/n)
n
Would you like to change your key? (y/n)
n
Would you like to change your key? (y/n)
n
Error: Failed to parse private key: HexError(InvalidHexCharacter { c: 'N', index: 0 })

Location:
    src/utils.rs:49:22

$ perp position -t 0x3aFxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Would you like to change your key? (y/n)
n
Would you like to change your key? (y/n)
y
Please provide the 64-character private key: (Without the 0x prefix)
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Key updated
Error: Failed to parse private key: EcdsaError(signature::Error { source: None })

Location:
    src/utils.rs:49:22

@brendanwenzel
Copy link
Owner

brendanwenzel commented Feb 11, 2023

Yes, that's something that I was already thinking about. Will work on adding that over the weekend.

In the meantime, I've been using the 1 private key as a read-only key:
0000000000000000000000000000000000000000000000000000000000000001

@brendanwenzel
Copy link
Owner

@SvenMeyer Would an acceptable solution be to make a default private key if the user either chooses no to changing the key or if the key given has an error? That seems to be the easiest to implement.

@lkblkb
Copy link

lkblkb commented Feb 13, 2023

@brendanwenzel works for me 😁

@brendanwenzel
Copy link
Owner

@brendanwenzel works for me 😁

Thank you @lkblkb for the feedback. Going to shoot to have this pushed by Tuesday.

Repository owner deleted a comment from Nitesh639 Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@SvenMeyer @brendanwenzel @lkblkb and others