feat(swqos): add Glaive transaction sender
This commit is contained in:
@@ -6,6 +6,8 @@ Shows two client-construction patterns: `TradingClient::new` for one wallet and
|
||||
|
||||
This is a configuration template. Set `PRIVATE_KEY`, RPC, and every enabled provider credential; it initializes network clients but does not submit a trade.
|
||||
|
||||
The Glaive entry uses QUIC by default. Its credential must be a UUID v4 API key from Glaive. Replace the fourth argument with `Some(SwqosTransport::Http)` to use binary HTTP instead.
|
||||
|
||||
```bash
|
||||
cargo run --package trading_client
|
||||
```
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
这是配置模板。运行前设置 `PRIVATE_KEY`、RPC 和所有已启用服务商凭证;程序会初始化网络客户端,但不会提交交易。
|
||||
|
||||
Glaive 配置默认使用 QUIC,其凭证必须是 Glaive 提供的 UUID v4 API key。若要改用 binary HTTP,把第四个参数替换为 `Some(SwqosTransport::Http)`。
|
||||
|
||||
```bash
|
||||
cargo run --package trading_client
|
||||
```
|
||||
|
||||
@@ -55,6 +55,20 @@ async fn create_trading_client_simple() -> AnyResult<TradingClient> {
|
||||
), // QUIC;None / Some(Binary) / Some(Plain) 为 HTTP
|
||||
// Helius Sender: 4th param swqos_only Some(true) => min tip 0.000005 SOL; None => 0.0002 SOL
|
||||
SwqosConfig::Helius("".to_string(), SwqosRegion::Default, None, Some(true)),
|
||||
// Glaive defaults to persistent QUIC (UDP/4000). Use Some(Http) for binary HTTP.
|
||||
SwqosConfig::Glaive(
|
||||
"your_glaive_uuid_v4_api_key".to_string(),
|
||||
SwqosRegion::Frankfurt,
|
||||
None,
|
||||
None,
|
||||
),
|
||||
// HTTP alternative:
|
||||
// SwqosConfig::Glaive(
|
||||
// "your_glaive_uuid_v4_api_key".to_string(),
|
||||
// SwqosRegion::Frankfurt,
|
||||
// None,
|
||||
// Some(sol_trade_sdk::SwqosTransport::Http),
|
||||
// ),
|
||||
];
|
||||
|
||||
let trade_config = TradeConfig::builder(rpc_url, swqos_configs, commitment)
|
||||
|
||||
Reference in New Issue
Block a user