-
Notifications
You must be signed in to change notification settings - Fork 62
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
invalid public key input:', <solana.account.Account object at 0x7f34954d5f40> #89
Comments
what is sender_keypair ?
On Sun, 10 Oct 2021 at 01:00, Hemant Sirsat ***@***.***> wrote:
I was implementing a buy function using pyserum and solana using the
following code.
payer=sender_keypair.public_key,
owner=Account(sender_keypair),
side=Side.BUY,
order_type=OrderType.LIMIT,
limit_price=0.5,
max_quantity=abs(1),
opts=TxOpts(skip_preflight=True)
)
The following error occurs:
ValueError: ('invalid public key input:', '<solana.account.Account object at 0x7fac2a7c2cd0>')
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#89>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACMFDUNZAIQPTS5BYMGWVODUGBYJFANCNFSM5FVPF3NA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Wang (Leonard) Ge
Imperial College London 2021
***@***.***
+44 - 079-364-72284
|
Sender_keypair(<class 'solana.keypair.Keypair'>) is the keypair of the owner's wallet. |
can you also include the code snippet on how you read from that? Omit the
actual key of course
On Sun, 10 Oct 2021 at 13:01, Hemant Sirsat ***@***.***> wrote:
Sender_keypair is the keypair of the owner's wallet.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACMFDULEEPF746BVO6KM2T3UGEM2XANCNFSM5FVPF3NA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Wang (Leonard) Ge
Imperial College London 2021
***@***.***
+44 - 079-364-72284
|
Here's the code. Ignore the unnecessary imports.
|
I've got the same error with this part of the traceback:
The full traceback is:
|
Interesting, let me take a closer look.
On Mon, 11 Oct 2021 at 18:02, Viktor Kulikov ***@***.***> wrote:
I've got the same error with this part of the traceback:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/solana/publickey.py", line 31, in __init__
self._key = base58.b58decode(value)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/base58/__init__.py", line 124, in b58decode
acc = b58decode_int(v, alphabet=alphabet, autofix=autofix)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/base58/__init__.py", line 104, in b58decode_int
raise ValueError(
ValueError: Invalid character <<>
The above exception was the direct cause of the following exception:```
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACMFDUOS3KR5GVYPNRXB22DUGKY4HANCNFSM5FVPF3NA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
--
Wang (Leonard) Ge
Imperial College London 2021
***@***.***
+44 - 079-364-72284
|
something like this change could work, that's all because in
|
probably better to patch market and the other libs to use Keypair instead of Account ? |
I tried changing |
First attempt at replacing Account with Keypair in the PR referenced above |
I believe it happens due to payer == SOL unwrapped public address. Does anybody know how to handle it? Or it is a bug? |
Did you find any solution? |
is this still failing with the latest release ? |
invalid public key input is solved. Although there's a new error. |
I'm also getting this same issue still. #95 looks to be a fix for this so I'm waiting for that. |
Turns out my issue can be fixed by simply settling funds before placing an order. Btw the payer account is your token account address, not your public key if you aren't dealing with SOL or USDC I think. |
And how did you achieve that? Can you share the snippet? |
I'll show this with an example using the ATLAS/USDC pair Say I want to buy the asset using USDC, I take my USDC address as the payer. If I wanted to sell the asset then the payer would be the address of the asset. This likely won't work if the payer address is your SOL wallet which will give the ValueError you got. If you want to buy something using SOL then idk how you would go about doing that. I just get my token address from raydium, you might want to instead do that by code.
|
I was implementing a buy function using pyserum and solana using the following code.
The following error occurs:
The text was updated successfully, but these errors were encountered: