Skip to content

Commit aae22fe

Browse files
v13.3.6 (#25)
1 parent c80be59 commit aae22fe

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "sakit"
3-
version = "13.3.5"
3+
version = "13.3.6"
44
description = "Solana Agent Kit"
55
authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
66
license = "MIT"

sakit/privy_recurring.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,12 @@ async def _privy_sign_transaction(
140140
# Convert the key to PKCS#8 format expected by the SDK
141141
pkcs8_key = _convert_key_to_pkcs8_pem(signing_key)
142142

143+
# IMPORTANT: The body must match exactly what the SDK sends to the API
143144
url = f"https://api.privy.io/v1/wallets/{wallet_id}/rpc"
144145
body = {
145146
"method": "signTransaction",
146147
"params": {"transaction": encoded_tx, "encoding": "base64"},
148+
"chain_type": "solana",
147149
}
148150

149151
auth_signature = get_authorization_signature(

sakit/privy_transfer.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,24 +123,30 @@ async def privy_sign_and_send(
123123
# Convert key to PKCS#8 PEM format for SDK compatibility
124124
pem_key = _convert_key_to_pkcs8_pem(privy_auth_key)
125125

126-
# Generate authorization signature using SDK
126+
# IMPORTANT: The body must match exactly what the SDK sends to the API
127+
# signAndSendTransaction requires caip2 for Solana
127128
url = f"https://api.privy.io/v1/wallets/{wallet_id}/rpc"
128129
body = {
129130
"method": "signAndSendTransaction",
130131
"params": {"transaction": encoded_tx, "encoding": "base64"},
132+
"caip2": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
133+
"chain_type": "solana",
131134
}
132135
auth_signature = get_authorization_signature(
133136
url=url,
134137
body=body,
135-
privy_app_id=privy_client.app_id,
136-
privy_authorization_key=pem_key,
138+
method="POST",
139+
app_id=privy_client.app_id,
140+
private_key=pem_key,
137141
)
138142

139143
# Use SDK's wallets.rpc method for signAndSendTransaction
140144
result = await privy_client.wallets.rpc(
141145
wallet_id=wallet_id,
142146
method="signAndSendTransaction",
143147
params={"transaction": encoded_tx, "encoding": "base64"},
148+
caip2="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
149+
chain_type="solana",
144150
privy_authorization_signature=auth_signature,
145151
)
146152

sakit/privy_trigger.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,12 @@ async def _privy_sign_transaction(
140140
# Convert the key to PKCS#8 format expected by the SDK
141141
pkcs8_key = _convert_key_to_pkcs8_pem(signing_key)
142142

143+
# IMPORTANT: The body must match exactly what the SDK sends to the API
143144
url = f"https://api.privy.io/v1/wallets/{wallet_id}/rpc"
144145
body = {
145146
"method": "signTransaction",
146147
"params": {"transaction": encoded_tx, "encoding": "base64"},
148+
"chain_type": "solana",
147149
}
148150

149151
auth_signature = get_authorization_signature(

sakit/privy_ultra.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,12 @@ async def privy_sign_transaction(
196196
pkcs8_key = convert_key_to_pkcs8_pem(signing_key)
197197

198198
# Generate the authorization signature using the SDK's utility
199+
# IMPORTANT: The body must match exactly what the SDK sends to the API
199200
url = f"https://api.privy.io/v1/wallets/{wallet_id}/rpc"
200201
body = {
201202
"method": "signTransaction",
202203
"params": {"transaction": encoded_tx, "encoding": "base64"},
204+
"chain_type": "solana",
203205
}
204206

205207
# Use SDK's authorization signature helper

0 commit comments

Comments
 (0)