| | |
| | | MARK_PRICE |
| | | } |
| | | |
| | | /** 账号标签(用于日志区分多账号) */ |
| | | private final String label; |
| | | /** Gate API v4 密钥 */ |
| | | private final String apiKey; |
| | | /** Gate API v4 签名密钥 */ |
| | |
| | | private final PnLPriceMode unrealizedPnlPriceMode; |
| | | |
| | | private GateConfig(Builder builder) { |
| | | this.label = builder.label; |
| | | this.apiKey = builder.apiKey; |
| | | this.apiSecret = builder.apiSecret; |
| | | this.contract = builder.contract; |
| | |
| | | : "wss://ws-testnet.gate.com/v4/ws/futures/usdt"; |
| | | } |
| | | |
| | | public String getLabel() { return label; } |
| | | public String getApiKey() { return apiKey; } |
| | | public String getApiSecret() { return apiSecret; } |
| | | public String getContract() { return contract; } |
| | |
| | | * GateConfig 的流式构造器,提供合理的默认值。 |
| | | */ |
| | | public static class Builder { |
| | | private String label = "default"; |
| | | private String apiKey; |
| | | private String apiSecret; |
| | | private String contract = "BTC_USDT"; |
| | |
| | | private BigDecimal contractMultiplier = new BigDecimal("0.001"); |
| | | private PnLPriceMode unrealizedPnlPriceMode = PnLPriceMode.LAST_PRICE; |
| | | |
| | | public Builder label(String label) { this.label = label; return this; } |
| | | public Builder apiKey(String apiKey) { this.apiKey = apiKey; return this; } |
| | | public Builder apiSecret(String apiSecret) { this.apiSecret = apiSecret; return this; } |
| | | public Builder contract(String contract) { this.contract = contract; return this; } |