pyserum icon indicating copy to clipboard operation
pyserum copied to clipboard

Settle_funds got signature issue.

Open jimmyntu opened this issue 2 years ago • 1 comments

Hi, I'm facing the error "transaction has not been signed correctly" when calling settle_funds. For way to reproduce:

  1. place order for SOL/USDC buy pair
  2. cancel the order
  3. settle back to the account.

Sample code:

result = market.settle_funds(
    owner=wallet, 
    open_orders=open_order_account, 
    base_wallet = PublicKey('....'),  # account for wrapped SOL
    quote_wallet = PublicKey('....'),  # account for USDC, this should where the balance of USDC goes to, after cancel the order.
    opts=TxOpts(skip_preflight=True))

print(f'Settle funds {result}')

Exception:

Traceback (most recent call last):
  File "/Users/xxxx/test/test-serum.py", line 108, in <module>
    result = market.settle_funds(
  File "/usr/local/lib/python3.9/site-packages/pyserum/market/market.py", line 169, in settle_funds
    return self._conn.send_transaction(transaction, owner, opts=opts)
  File "/usr/local/lib/python3.9/site-packages/solana/rpc/api.py", line 1281, in send_transaction
    txn_resp = self.send_raw_transaction(txn.serialize(), opts=opts)
  File "/usr/local/lib/python3.9/site-packages/solana/transaction.py", line 368, in serialize
    raise AttributeError("transaction has not been signed correctly")
AttributeError: transaction has not been signed correctly

jimmyntu avatar May 01 '22 11:05 jimmyntu