Skip to content

Commit c791858

Browse files
committed
fix sol transactions
1 parent 58883c9 commit c791858

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

agixt/payments/crypto.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,15 @@ async def _verify_on_solana(
167167

168168
# Extract account keys from the transaction message
169169
transaction = value.transaction.transaction
170-
account_keys = [str(key) for key in transaction.message.account_keys]
170+
raw_keys = transaction.message.account_keys
171+
172+
# Handle both ParsedAccount objects (from jsonParsed encoding) and raw keys
173+
if raw_keys and hasattr(raw_keys[0], "pubkey"):
174+
# ParsedAccount objects - extract pubkey attribute
175+
account_keys = [str(key.pubkey) for key in raw_keys]
176+
else:
177+
# Raw public keys
178+
account_keys = [str(key) for key in raw_keys]
171179

172180
# Convert token balances from solders objects to dictionaries
173181
def convert_token_balance(tb):

0 commit comments

Comments
 (0)