Skip to content

Commit 60edae1

Browse files
v14.1.6 (#37)
1 parent 1b2e59b commit 60edae1

File tree

7 files changed

+11
-33
lines changed

7 files changed

+11
-33
lines changed

.coverage

0 Bytes
Binary file not shown.

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ By default, Jupiter Ultra provides gasless swaps when the user has < 0.01 SOL an
104104

105105
This plugin enables Solana Agent to swap tokens using DFlow's Swap API with a Solana keypair. DFlow offers faster swaps compared to Jupiter Ultra with competitive rates.
106106

107+
**Note:** Platform fees are not supported with DFlow. Use Jupiter Ultra (solana_ultra) if you need to collect fees on swaps.
108+
107109
```python
108110
config = {
109111
"tools": {
110112
"solana_dflow_swap": {
111113
"private_key": "my-private-key", # Required - base58 string
112114
"payer_private_key": "payer-private-key", # Optional - for gasless/sponsored transactions
113115
"rpc_url": "https://api.mainnet-beta.solana.com", # Optional - RPC URL (defaults to mainnet)
114-
"platform_fee_bps": 50, # Optional - fee in basis points (50 = 0.5%)
115-
"referral_account": "your-wallet-pubkey", # Optional - wallet to receive fees (DFlow creates ATAs automatically)
116116
},
117117
},
118118
}
@@ -121,7 +121,6 @@ config = {
121121
**Features:**
122122
- **Fast Swaps**: DFlow typically executes faster than Jupiter Ultra
123123
- **Gasless Transactions**: Optionally sponsor gas fees for users via `payer_private_key`
124-
- **Platform Fees**: Collect fees on swaps via `referral_account` - DFlow auto-creates token accounts
125124

126125
### Jupiter Trigger
127126

@@ -366,6 +365,8 @@ This plugin enables Solana Agent to swap tokens using DFlow's Swap API with Priv
366365

367366
Transactions are signed via Privy and sent via your configured RPC (Helius recommended) for reliable blockhash handling and priority fees.
368367

368+
**Note:** Platform fees are not supported with DFlow. Use Jupiter Ultra (privy_ultra) if you need to collect fees on swaps.
369+
369370
```python
370371
config = {
371372
"tools": {
@@ -375,8 +376,6 @@ config = {
375376
"signing_key": "wallet-auth:your-signing-key", # Required - your Privy wallet authorization signing key
376377
"rpc_url": "https://mainnet.helius-rpc.com/?api-key=YOUR_KEY", # Required - Helius recommended for priority fees
377378
"payer_private_key": "payer-private-key", # Optional - for gasless/sponsored transactions
378-
"platform_fee_bps": 50, # Optional - fee in basis points (50 = 0.5%)
379-
"referral_account": "your-wallet-pubkey", # Optional - wallet to receive fees (DFlow creates ATAs automatically)
380379
},
381380
},
382381
}
@@ -387,7 +386,6 @@ config = {
387386
- **Privy Delegated Wallets**: Seamless user experience with embedded wallets
388387
- **Helius Priority Fees**: Uses Helius priority fee estimation for reliable transaction landing
389388
- **Gasless Transactions**: Optionally sponsor gas fees for users via `payer_private_key`
390-
- **Platform Fees**: Collect fees on swaps via `referral_account` - DFlow auto-creates token accounts
391389

392390
**RPC URL (Required):**
393391
Helius RPC is strongly recommended (`https://mainnet.helius-rpc.com/?api-key=YOUR_KEY`). Helius provides priority fee estimation and better blockhash handling, which significantly improves transaction success rates. Get a free API key at [helius.dev](https://helius.dev).

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 = "14.1.5"
3+
version = "14.1.6"
44
description = "Solana Agent Kit"
55
authors = ["Bevan Hunt <bevan@bevanhunt.com>"]
66
license = "MIT"

sakit/privy_dflow_swap.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
Transactions are signed via Privy's signTransaction and sent via Helius RPC
99
for priority fees and reliable blockhash handling.
1010
11-
Supports platform fee collection via referralAccount - DFlow auto-creates the
12-
required token accounts to receive fees in the output token.
11+
Note: Platform fees are not supported. DFlow requires a specific token account
12+
(ATA) for each output token to collect fees, which is impractical for a
13+
general-purpose swap tool. Use Jupiter Ultra (privy_ultra) if you need fees.
1314
"""
1415

1516
import base64
@@ -210,8 +211,6 @@ def __init__(self, registry: Optional[ToolRegistry] = None):
210211
self._signing_key: Optional[str] = None
211212
self._payer_private_key: Optional[str] = None
212213
self._rpc_url: Optional[str] = None
213-
self._platform_fee_bps: Optional[int] = None
214-
self._referral_account: Optional[str] = None
215214

216215
def get_schema(self) -> Dict[str, Any]:
217216
return {
@@ -252,9 +251,6 @@ def configure(self, config: Dict[str, Any]) -> None:
252251
self._payer_private_key = tool_cfg.get("payer_private_key")
253252
# RPC URL for sending transactions (Helius recommended for priority fees)
254253
self._rpc_url = tool_cfg.get("rpc_url")
255-
# Platform fee configuration (uses referralAccount for auto ATA creation)
256-
self._platform_fee_bps = tool_cfg.get("platform_fee_bps")
257-
self._referral_account = tool_cfg.get("referral_account")
258254

259255
async def execute( # pragma: no cover
260256
self,
@@ -307,8 +303,6 @@ async def execute( # pragma: no cover
307303
user_public_key=public_key,
308304
slippage_bps=slippage_bps if slippage_bps > 0 else None,
309305
sponsor=sponsor,
310-
platform_fee_bps=self._platform_fee_bps,
311-
referral_account=self._referral_account,
312306
)
313307

314308
if not order_result.success:

sakit/solana_dflow_swap.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
Enables fast token swaps using DFlow's Swap API with a Solana keypair.
44
DFlow offers faster swaps compared to Jupiter Ultra with similar liquidity.
55
6-
Supports platform fee collection via referralAccount - DFlow auto-creates the
7-
required token accounts to receive fees in the output token.
6+
Note: Platform fees are not supported. DFlow requires a specific token account
7+
(ATA) for each output token to collect fees, which is impractical for a
8+
general-purpose swap tool. Use Jupiter Ultra (solana_ultra) if you need fees.
89
"""
910

1011
import base64
@@ -80,8 +81,6 @@ def __init__(self, registry: Optional[ToolRegistry] = None):
8081
self._private_key: Optional[str] = None
8182
self._payer_private_key: Optional[str] = None
8283
self._rpc_url: Optional[str] = None
83-
self._platform_fee_bps: Optional[int] = None
84-
self._referral_account: Optional[str] = None
8584

8685
def get_schema(self) -> Dict[str, Any]:
8786
return {
@@ -115,9 +114,6 @@ def configure(self, config: Dict[str, Any]) -> None:
115114
self._private_key = tool_cfg.get("private_key")
116115
self._payer_private_key = tool_cfg.get("payer_private_key")
117116
self._rpc_url = tool_cfg.get("rpc_url") or DEFAULT_RPC_URL
118-
# Platform fee configuration (uses referralAccount for auto ATA creation)
119-
self._platform_fee_bps = tool_cfg.get("platform_fee_bps")
120-
self._referral_account = tool_cfg.get("referral_account")
121117

122118
async def execute(
123119
self,
@@ -151,8 +147,6 @@ async def execute(
151147
user_public_key=user_pubkey,
152148
slippage_bps=slippage_bps if slippage_bps > 0 else None,
153149
sponsor=sponsor,
154-
platform_fee_bps=self._platform_fee_bps,
155-
referral_account=self._referral_account,
156150
)
157151

158152
if not order_result.success:

tests/test_privy_dflow_swap_tool.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ def test_configure_sets_credentials(self):
6767
"signing_key": "test_signing_key",
6868
"payer_private_key": "payer_key",
6969
"rpc_url": "https://custom-rpc.com",
70-
"platform_fee_bps": 50,
71-
"referral_account": "RefAcct123",
7270
}
7371
}
7472
}
@@ -80,8 +78,6 @@ def test_configure_sets_credentials(self):
8078
assert tool._signing_key == "test_signing_key"
8179
assert tool._payer_private_key == "payer_key"
8280
assert tool._rpc_url == "https://custom-rpc.com"
83-
assert tool._platform_fee_bps == 50
84-
assert tool._referral_account == "RefAcct123"
8581

8682

8783
class TestPrivyDFlowSwapToolExecute:

tests/test_solana_dflow_swap_tool.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ def test_configure_sets_credentials(self):
7171
"private_key": "test_private_key",
7272
"payer_private_key": "payer_key",
7373
"rpc_url": "https://custom-rpc.com",
74-
"platform_fee_bps": 50,
75-
"referral_account": "RefAcct123",
7674
}
7775
}
7876
}
@@ -82,8 +80,6 @@ def test_configure_sets_credentials(self):
8280
assert tool._private_key == "test_private_key"
8381
assert tool._payer_private_key == "payer_key"
8482
assert tool._rpc_url == "https://custom-rpc.com"
85-
assert tool._platform_fee_bps == 50
86-
assert tool._referral_account == "RefAcct123"
8783

8884
def test_configure_uses_default_rpc_url(self):
8985
"""Should use default RPC URL when not provided."""

0 commit comments

Comments
 (0)