@dshtrading/connector-alpaca 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +4 -3
- package/lib/rest.js +1 -0
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -253,10 +253,11 @@ function createPlaceOrderTool(deps) {
|
|
|
253
253
|
}
|
|
254
254
|
const order = await deps.trade.placeOrder({
|
|
255
255
|
symbol: args.symbol,
|
|
256
|
-
side: args.side,
|
|
257
|
-
type: args.type,
|
|
256
|
+
side: args.side === "SELL" ? "sell" : "buy",
|
|
257
|
+
type: args.type === "LIMIT" ? "limit" : "market",
|
|
258
258
|
quantity: args.quantity,
|
|
259
|
-
price: args.price
|
|
259
|
+
price: args.price,
|
|
260
|
+
dryRun: false
|
|
260
261
|
});
|
|
261
262
|
return JSON.stringify(order);
|
|
262
263
|
}
|
package/lib/rest.js
CHANGED
|
@@ -272,6 +272,7 @@ var AlpacaRestClient = class {
|
|
|
272
272
|
await this.request(this.tradingBaseUrl, `/orders/${orderId}`, { method: "DELETE" }, credentials);
|
|
273
273
|
} catch (err) {
|
|
274
274
|
if (err instanceof TradingServiceError && err.code === "TRADING_UNSUPPORTED_SYMBOL") return;
|
|
275
|
+
throw err;
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
278
|
async getOrder(credentials, orderId) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dshtrading/connector-alpaca",
|
|
3
3
|
"description": "【模板】交易所连接器插件脚手架:Alpaca(alpaca)v2 插件骨架 —— 市场数据服务 + 交易服务 + 三态闸门 + BYOK 凭证 ref。生成器:node scripts/new-connector.mjs --slug <exchange>",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "./lib/index.d.ts",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
],
|
|
22
22
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@dshtrading/api": "^0.1.
|
|
24
|
+
"@dshtrading/api": "^0.1.2"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@deepseek-ai/cordis": ">=4.0.0",
|
|
28
|
-
"@deepseek-ai/dsh-tools": ">=0.1.2-
|
|
28
|
+
"@deepseek-ai/dsh-tools": ">=0.1.2-rc.1",
|
|
29
29
|
"@deepseek-ai/schemastery": ">=3.18.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|