@yuants/vendor-binance 0.9.0 → 0.10.1
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/dist/api/client.js +14 -3
- package/dist/api/client.js.map +1 -1
- package/dist/api/public-api.js +6 -0
- package/dist/api/public-api.js.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy_index.js +163 -197
- package/dist/legacy_index.js.map +1 -1
- package/dist/public-data/product.js +82 -3
- package/dist/public-data/product.js.map +1 -1
- package/dist/public-data/quote.js +2 -2
- package/dist/public-data/quote.js.map +1 -1
- package/dist/services/accounts/profile.js +4 -15
- package/dist/services/accounts/profile.js.map +1 -1
- package/dist/services/accounts/spot.js.map +1 -1
- package/dist/services/accounts/unified.js +1 -11
- package/dist/services/accounts/unified.js.map +1 -1
- package/dist/services/exchange.js +56 -0
- package/dist/services/exchange.js.map +1 -0
- package/dist/services/orders/listOrders.js +44 -35
- package/dist/services/orders/listOrders.js.map +1 -1
- package/lib/api/client.d.ts.map +1 -1
- package/lib/api/client.js +13 -2
- package/lib/api/client.js.map +1 -1
- package/lib/api/public-api.d.ts +41 -0
- package/lib/api/public-api.d.ts.map +1 -1
- package/lib/api/public-api.js +8 -1
- package/lib/api/public-api.js.map +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy_index.d.ts +0 -1
- package/lib/legacy_index.js +162 -198
- package/lib/legacy_index.js.map +1 -1
- package/lib/public-data/product.d.ts +2 -1
- package/lib/public-data/product.d.ts.map +1 -1
- package/lib/public-data/product.js +83 -2
- package/lib/public-data/product.js.map +1 -1
- package/lib/public-data/quote.js +2 -2
- package/lib/public-data/quote.js.map +1 -1
- package/lib/services/accounts/profile.d.ts +1 -5
- package/lib/services/accounts/profile.d.ts.map +1 -1
- package/lib/services/accounts/profile.js +6 -17
- package/lib/services/accounts/profile.js.map +1 -1
- package/lib/services/accounts/spot.d.ts +2 -2
- package/lib/services/accounts/spot.d.ts.map +1 -1
- package/lib/services/accounts/spot.js.map +1 -1
- package/lib/services/accounts/unified.d.ts +2 -2
- package/lib/services/accounts/unified.d.ts.map +1 -1
- package/lib/services/accounts/unified.js +1 -11
- package/lib/services/accounts/unified.js.map +1 -1
- package/lib/services/exchange.d.ts +2 -0
- package/lib/services/exchange.d.ts.map +1 -0
- package/lib/services/exchange.js +58 -0
- package/lib/services/exchange.js.map +1 -0
- package/lib/services/orders/listOrders.d.ts +4 -2
- package/lib/services/orders/listOrders.d.ts.map +1 -1
- package/lib/services/orders/listOrders.js +47 -36
- package/lib/services/orders/listOrders.js.map +1 -1
- package/package.json +16 -16
- package/temp/package-deps.json +30 -30
- package/dist/services/account-actions-with-credential.js +0 -34
- package/dist/services/account-actions-with-credential.js.map +0 -1
- package/dist/services/order-actions-with-credential.js +0 -21
- package/dist/services/order-actions-with-credential.js.map +0 -1
- package/lib/services/account-actions-with-credential.d.ts +0 -2
- package/lib/services/account-actions-with-credential.d.ts.map +0 -1
- package/lib/services/account-actions-with-credential.js +0 -36
- package/lib/services/account-actions-with-credential.js.map +0 -1
- package/lib/services/order-actions-with-credential.d.ts +0 -2
- package/lib/services/order-actions-with-credential.d.ts.map +0 -1
- package/lib/services/order-actions-with-credential.js +0 -23
- package/lib/services/order-actions-with-credential.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuants/vendor-binance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -8,20 +8,20 @@
|
|
|
8
8
|
"temp"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@yuants/protocol": "0.53.
|
|
12
|
-
"@yuants/data-account": "0.8.
|
|
13
|
-
"@yuants/cache": "0.3.
|
|
14
|
-
"@yuants/data-quote": "0.2.
|
|
15
|
-
"@yuants/utils": "0.
|
|
16
|
-
"@yuants/data-series": "0.3.
|
|
17
|
-
"@yuants/sql": "0.9.
|
|
18
|
-
"@yuants/data-product": "0.4.
|
|
19
|
-
"@yuants/data-ohlc": "0.4.
|
|
20
|
-
"@yuants/data-order": "0.6.
|
|
21
|
-
"@yuants/data-interest-rate": "0.1.
|
|
22
|
-
"@yuants/transfer": "0.2.
|
|
23
|
-
"
|
|
24
|
-
"
|
|
11
|
+
"@yuants/protocol": "0.53.1",
|
|
12
|
+
"@yuants/data-account": "0.8.3",
|
|
13
|
+
"@yuants/cache": "0.3.3",
|
|
14
|
+
"@yuants/data-quote": "0.2.42",
|
|
15
|
+
"@yuants/utils": "0.14.0",
|
|
16
|
+
"@yuants/data-series": "0.3.50",
|
|
17
|
+
"@yuants/sql": "0.9.29",
|
|
18
|
+
"@yuants/data-product": "0.4.20",
|
|
19
|
+
"@yuants/data-ohlc": "0.4.21",
|
|
20
|
+
"@yuants/data-order": "0.6.5",
|
|
21
|
+
"@yuants/data-interest-rate": "0.1.47",
|
|
22
|
+
"@yuants/transfer": "0.2.38",
|
|
23
|
+
"@yuants/exchange": "0.1.1",
|
|
24
|
+
"rxjs": "~7.5.6"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@microsoft/api-extractor": "~7.30.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@rushstack/heft-node-rig": "~1.10.7",
|
|
31
31
|
"@types/heft-jest": "1.0.3",
|
|
32
32
|
"@types/node": "22",
|
|
33
|
-
"@yuants/extension": "0.2.
|
|
33
|
+
"@yuants/extension": "0.2.31",
|
|
34
34
|
"@yuants/tool-kit": "0.2.1",
|
|
35
35
|
"typescript": "~4.7.4",
|
|
36
36
|
"ts-node": "~10.9.2"
|
package/temp/package-deps.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"apps/vendor-binance/AGENTS.md": "378369925bffa237cd5e8ef459fe2bc2a141337c",
|
|
3
|
-
"apps/vendor-binance/CHANGELOG.json": "
|
|
4
|
-
"apps/vendor-binance/CHANGELOG.md": "
|
|
3
|
+
"apps/vendor-binance/CHANGELOG.json": "972d3a58c0e23c9d2aa29e4fe6bc05b77731abbf",
|
|
4
|
+
"apps/vendor-binance/CHANGELOG.md": "d586acafda0824658cafd315f781cb77c5e1c942",
|
|
5
5
|
"apps/vendor-binance/README.md": "4ab94c08b3d07398aee74c3264a4f87d554d20fa",
|
|
6
|
-
"apps/vendor-binance/SESSION_NOTES.md": "
|
|
6
|
+
"apps/vendor-binance/SESSION_NOTES.md": "323540130bec032bd3e4231c7bbcfc0013a17631",
|
|
7
7
|
"apps/vendor-binance/api-extractor.json": "62f4fd324425b9a235f0c117975967aab09ced0c",
|
|
8
8
|
"apps/vendor-binance/config/jest.config.json": "4bb17bde3ee911163a3edb36a6eb71491d80b1bd",
|
|
9
9
|
"apps/vendor-binance/config/rig.json": "f6c7b5537dc77a3170ba9f008bae3b6c3ee11956",
|
|
10
10
|
"apps/vendor-binance/config/typescript.json": "854907e8a821f2050f6533368db160c649c25348",
|
|
11
11
|
"apps/vendor-binance/etc/vendor-binance.api.md": "2094b84e9b5e7503f5c42b31fffee8d7db47fe7b",
|
|
12
|
-
"apps/vendor-binance/package.json": "
|
|
13
|
-
"apps/vendor-binance/src/api/client.ts": "
|
|
12
|
+
"apps/vendor-binance/package.json": "17351a1232ff2b7ab135efd442a1bd5c91e94319",
|
|
13
|
+
"apps/vendor-binance/src/api/client.ts": "4d853dcbc46f08054dfbf6b985f776a3231a8138",
|
|
14
14
|
"apps/vendor-binance/src/api/private-api.ts": "e7643bd482e4d8f4eefe39aee578e5ea52094b2b",
|
|
15
|
-
"apps/vendor-binance/src/api/public-api.ts": "
|
|
16
|
-
"apps/vendor-binance/src/index.ts": "
|
|
17
|
-
"apps/vendor-binance/src/legacy_index.ts": "
|
|
15
|
+
"apps/vendor-binance/src/api/public-api.ts": "7ff3b6551cdf1766b4a31cdf76002ce1db11f109",
|
|
16
|
+
"apps/vendor-binance/src/index.ts": "285cc4bded3608d415aaa00b9df180fbbdcebac0",
|
|
17
|
+
"apps/vendor-binance/src/legacy_index.ts": "a2b44c041aa7ef1f4b77249e11f84d97cde5525f",
|
|
18
18
|
"apps/vendor-binance/src/public-data/interest_rate.ts": "a95d6d8784a9d5b0a82105247a36ae793df82ae0",
|
|
19
19
|
"apps/vendor-binance/src/public-data/ohlc.ts": "bb4f791f96064eca7d45d361ea36cb8ba0ab8fe0",
|
|
20
|
-
"apps/vendor-binance/src/public-data/product.ts": "
|
|
21
|
-
"apps/vendor-binance/src/public-data/quote.ts": "
|
|
22
|
-
"apps/vendor-binance/src/services/
|
|
23
|
-
"apps/vendor-binance/src/services/accounts/
|
|
24
|
-
"apps/vendor-binance/src/services/accounts/
|
|
25
|
-
"apps/vendor-binance/src/services/
|
|
26
|
-
"apps/vendor-binance/src/services/order-actions-with-credential.ts": "d7ea63781f6c4d3a47e453a48935692c3c9e761d",
|
|
20
|
+
"apps/vendor-binance/src/public-data/product.ts": "a25f998f917cc94c029984c4f9f38fe56a9ef3e6",
|
|
21
|
+
"apps/vendor-binance/src/public-data/quote.ts": "5a034f952736b50ce9d1939c588ba163ac975c38",
|
|
22
|
+
"apps/vendor-binance/src/services/accounts/profile.ts": "1d23b04d19c078e8c21f41efd6ca3db37b0bd206",
|
|
23
|
+
"apps/vendor-binance/src/services/accounts/spot.ts": "144315335e7fa00737cd66402622a649d4bf0cab",
|
|
24
|
+
"apps/vendor-binance/src/services/accounts/unified.ts": "1a6aea6b993fbefce9073761b69bb5b92519da36",
|
|
25
|
+
"apps/vendor-binance/src/services/exchange.ts": "c989e025b771f5d5c49efcc779ca388dfb1d488d",
|
|
27
26
|
"apps/vendor-binance/src/services/orders/cancelOrder.ts": "7177ca56fd09b11651edbb38e1962363ac67d4ff",
|
|
28
|
-
"apps/vendor-binance/src/services/orders/listOrders.ts": "
|
|
27
|
+
"apps/vendor-binance/src/services/orders/listOrders.ts": "baa21b8e858c1ec593415145cc63fb38a6841d3f",
|
|
29
28
|
"apps/vendor-binance/src/services/orders/modifyOrder.ts": "0d1ec4d683e43876e9d53ee29cdc5324301b287e",
|
|
30
29
|
"apps/vendor-binance/src/services/orders/order-utils.ts": "e5278e306dc0e21f7e010424ead327249b1139cc",
|
|
31
30
|
"apps/vendor-binance/src/services/orders/submitOrder.ts": "1e05c8900c9d5e774953a4df22b07639fa927b29",
|
|
32
31
|
"apps/vendor-binance/tsconfig.json": "81da8f78196974b5d15da0edb6b2d9f48641063c",
|
|
33
|
-
"apps/vendor-binance/.rush/temp/shrinkwrap-deps.json": "
|
|
34
|
-
"libraries/protocol/temp/package-deps.json": "
|
|
35
|
-
"libraries/data-account/temp/package-deps.json": "
|
|
36
|
-
"libraries/cache/temp/package-deps.json": "
|
|
37
|
-
"libraries/data-quote/temp/package-deps.json": "
|
|
38
|
-
"libraries/utils/temp/package-deps.json": "
|
|
39
|
-
"libraries/data-series/temp/package-deps.json": "
|
|
40
|
-
"libraries/sql/temp/package-deps.json": "
|
|
41
|
-
"libraries/data-product/temp/package-deps.json": "
|
|
42
|
-
"libraries/data-ohlc/temp/package-deps.json": "
|
|
43
|
-
"libraries/data-order/temp/package-deps.json": "
|
|
44
|
-
"libraries/data-interest-rate/temp/package-deps.json": "
|
|
45
|
-
"libraries/transfer/temp/package-deps.json": "
|
|
46
|
-
"libraries/
|
|
32
|
+
"apps/vendor-binance/.rush/temp/shrinkwrap-deps.json": "0408a4d9b00c1701e07aa22f8350e585241c4581",
|
|
33
|
+
"libraries/protocol/temp/package-deps.json": "14095036ed251977cb3fb362a7e23d8786aaa4c9",
|
|
34
|
+
"libraries/data-account/temp/package-deps.json": "eb3d9ccad211a998fef9e0230e164407bf1b95fc",
|
|
35
|
+
"libraries/cache/temp/package-deps.json": "a4afa15e6462983f9d3735d31dc1ed8a683fb4dc",
|
|
36
|
+
"libraries/data-quote/temp/package-deps.json": "5a46a556f6eb8f2c682b092ee4703207e226ea8a",
|
|
37
|
+
"libraries/utils/temp/package-deps.json": "6d58e9b325e8d16de8a878c32010f626b12a01da",
|
|
38
|
+
"libraries/data-series/temp/package-deps.json": "d70ec6d1ca7342204a35a1c3619481e226239e73",
|
|
39
|
+
"libraries/sql/temp/package-deps.json": "95cd7209bf6002d530eb37960bac77c793afadd0",
|
|
40
|
+
"libraries/data-product/temp/package-deps.json": "60b8abf6f95edc29268f10f0d64331e2f034a3e5",
|
|
41
|
+
"libraries/data-ohlc/temp/package-deps.json": "959dd21977a31d4d9b623425c4c443d33729416d",
|
|
42
|
+
"libraries/data-order/temp/package-deps.json": "cf5b85fc4c5160f51023f7fbdc68a7ed9db5573a",
|
|
43
|
+
"libraries/data-interest-rate/temp/package-deps.json": "92396227ed3aab2f407bf93c515cf340ac796932",
|
|
44
|
+
"libraries/transfer/temp/package-deps.json": "0be7967706065779def1ef1e7f68a9794690599a",
|
|
45
|
+
"libraries/exchange/temp/package-deps.json": "68091305dec4ea0dc245f4314f1d474a2c3247d8",
|
|
46
|
+
"libraries/extension/temp/package-deps.json": "9569c553c2f9a7d50b70d8f101fc2d3825aaccb9",
|
|
47
47
|
"tools/toolkit/temp/package-deps.json": "23e053490eb8feade23e4d45de4e54883e322711"
|
|
48
48
|
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { provideAccountActionsWithCredential } from '@yuants/data-account';
|
|
2
|
-
import { Terminal } from '@yuants/protocol';
|
|
3
|
-
import { resolveAccountProfile } from './accounts/profile';
|
|
4
|
-
import { getUnifiedAccountInfo } from './accounts/unified';
|
|
5
|
-
import { getSpotAccountInfoSnapshot } from './accounts/spot';
|
|
6
|
-
const terminal = Terminal.fromNodeEnv();
|
|
7
|
-
const listAccounts = async (credential) => {
|
|
8
|
-
const profile = await resolveAccountProfile(credential);
|
|
9
|
-
return [
|
|
10
|
-
{ account_id: `binance/${profile.uid}/unified/usdt` },
|
|
11
|
-
{ account_id: `binance/${profile.uid}/spot/usdt` },
|
|
12
|
-
];
|
|
13
|
-
};
|
|
14
|
-
const getAccountInfo = async (credential, accountId) => {
|
|
15
|
-
if (accountId.includes('/unified/')) {
|
|
16
|
-
return getUnifiedAccountInfo(credential, accountId);
|
|
17
|
-
}
|
|
18
|
-
if (accountId.includes('/spot/')) {
|
|
19
|
-
return getSpotAccountInfoSnapshot(credential, accountId);
|
|
20
|
-
}
|
|
21
|
-
throw new Error(`Unsupported account_id: ${accountId}`);
|
|
22
|
-
};
|
|
23
|
-
provideAccountActionsWithCredential(terminal, 'BINANCE', {
|
|
24
|
-
type: 'object',
|
|
25
|
-
required: ['access_key', 'secret_key'],
|
|
26
|
-
properties: {
|
|
27
|
-
access_key: { type: 'string' },
|
|
28
|
-
secret_key: { type: 'string' },
|
|
29
|
-
},
|
|
30
|
-
}, {
|
|
31
|
-
listAccounts,
|
|
32
|
-
getAccountInfo,
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=account-actions-with-credential.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account-actions-with-credential.js","sourceRoot":"","sources":["../../src/services/account-actions-with-credential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mCAAmC,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;AAExC,MAAM,YAAY,GAAG,KAAK,EAAE,UAAuB,EAAE,EAAE;IACrD,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,UAAU,CAAC,CAAC;IACxD,OAAO;QACL,EAAE,UAAU,EAAE,WAAW,OAAO,CAAC,GAAG,eAAe,EAAE;QACrD,EAAE,UAAU,EAAE,WAAW,OAAO,CAAC,GAAG,YAAY,EAAE;KACnD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,KAAK,EAAE,UAAuB,EAAE,SAAiB,EAAE,EAAE;IAC1E,IAAI,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QACnC,OAAO,qBAAqB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;KACrD;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAChC,OAAO,0BAA0B,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;KAC1D;IACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,SAAS,EAAE,CAAC,CAAC;AAC1D,CAAC,CAAC;AAEF,mCAAmC,CACjC,QAAQ,EACR,SAAS,EACT;IACE,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,UAAU,EAAE;QACV,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC/B;CACF,EACD;IACE,YAAY;IACZ,cAAc;CACf,CACF,CAAC","sourcesContent":["import { provideAccountActionsWithCredential } from '@yuants/data-account';\nimport { Terminal } from '@yuants/protocol';\nimport { ICredential } from '../api/private-api';\nimport { resolveAccountProfile } from './accounts/profile';\nimport { getUnifiedAccountInfo } from './accounts/unified';\nimport { getSpotAccountInfoSnapshot } from './accounts/spot';\n\nconst terminal = Terminal.fromNodeEnv();\n\nconst listAccounts = async (credential: ICredential) => {\n const profile = await resolveAccountProfile(credential);\n return [\n { account_id: `binance/${profile.uid}/unified/usdt` },\n { account_id: `binance/${profile.uid}/spot/usdt` },\n ];\n};\n\nconst getAccountInfo = async (credential: ICredential, accountId: string) => {\n if (accountId.includes('/unified/')) {\n return getUnifiedAccountInfo(credential, accountId);\n }\n if (accountId.includes('/spot/')) {\n return getSpotAccountInfoSnapshot(credential, accountId);\n }\n throw new Error(`Unsupported account_id: ${accountId}`);\n};\n\nprovideAccountActionsWithCredential<ICredential>(\n terminal,\n 'BINANCE',\n {\n type: 'object',\n required: ['access_key', 'secret_key'],\n properties: {\n access_key: { type: 'string' },\n secret_key: { type: 'string' },\n },\n },\n {\n listAccounts,\n getAccountInfo,\n },\n);\n"]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { provideOrderActionsWithCredential } from '@yuants/data-order';
|
|
2
|
-
import { Terminal } from '@yuants/protocol';
|
|
3
|
-
import { cancelOrder } from './orders/cancelOrder';
|
|
4
|
-
import { listOrders } from './orders/listOrders';
|
|
5
|
-
import { modifyOrder } from './orders/modifyOrder';
|
|
6
|
-
import { submitOrder } from './orders/submitOrder';
|
|
7
|
-
const terminal = Terminal.fromNodeEnv();
|
|
8
|
-
provideOrderActionsWithCredential(terminal, 'BINANCE', {
|
|
9
|
-
type: 'object',
|
|
10
|
-
required: ['access_key', 'secret_key'],
|
|
11
|
-
properties: {
|
|
12
|
-
access_key: { type: 'string' },
|
|
13
|
-
secret_key: { type: 'string' },
|
|
14
|
-
},
|
|
15
|
-
}, {
|
|
16
|
-
submitOrder,
|
|
17
|
-
cancelOrder,
|
|
18
|
-
modifyOrder,
|
|
19
|
-
listOrders,
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=order-actions-with-credential.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order-actions-with-credential.js","sourceRoot":"","sources":["../../src/services/order-actions-with-credential.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;AAExC,iCAAiC,CAC/B,QAAQ,EACR,SAAS,EACT;IACE,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,UAAU,EAAE;QACV,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC/B;CACF,EACD;IACE,WAAW;IACX,WAAW;IACX,WAAW;IACX,UAAU;CACX,CACF,CAAC","sourcesContent":["import { provideOrderActionsWithCredential } from '@yuants/data-order';\nimport { Terminal } from '@yuants/protocol';\nimport { ICredential } from '../api/private-api';\nimport { cancelOrder } from './orders/cancelOrder';\nimport { listOrders } from './orders/listOrders';\nimport { modifyOrder } from './orders/modifyOrder';\nimport { submitOrder } from './orders/submitOrder';\n\nconst terminal = Terminal.fromNodeEnv();\n\nprovideOrderActionsWithCredential<ICredential>(\n terminal,\n 'BINANCE',\n {\n type: 'object',\n required: ['access_key', 'secret_key'],\n properties: {\n access_key: { type: 'string' },\n secret_key: { type: 'string' },\n },\n },\n {\n submitOrder,\n cancelOrder,\n modifyOrder,\n listOrders,\n },\n);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account-actions-with-credential.d.ts","sourceRoot":"","sources":["../../src/services/account-actions-with-credential.ts"],"names":[],"mappings":""}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const data_account_1 = require("@yuants/data-account");
|
|
4
|
-
const protocol_1 = require("@yuants/protocol");
|
|
5
|
-
const profile_1 = require("./accounts/profile");
|
|
6
|
-
const unified_1 = require("./accounts/unified");
|
|
7
|
-
const spot_1 = require("./accounts/spot");
|
|
8
|
-
const terminal = protocol_1.Terminal.fromNodeEnv();
|
|
9
|
-
const listAccounts = async (credential) => {
|
|
10
|
-
const profile = await (0, profile_1.resolveAccountProfile)(credential);
|
|
11
|
-
return [
|
|
12
|
-
{ account_id: `binance/${profile.uid}/unified/usdt` },
|
|
13
|
-
{ account_id: `binance/${profile.uid}/spot/usdt` },
|
|
14
|
-
];
|
|
15
|
-
};
|
|
16
|
-
const getAccountInfo = async (credential, accountId) => {
|
|
17
|
-
if (accountId.includes('/unified/')) {
|
|
18
|
-
return (0, unified_1.getUnifiedAccountInfo)(credential, accountId);
|
|
19
|
-
}
|
|
20
|
-
if (accountId.includes('/spot/')) {
|
|
21
|
-
return (0, spot_1.getSpotAccountInfoSnapshot)(credential, accountId);
|
|
22
|
-
}
|
|
23
|
-
throw new Error(`Unsupported account_id: ${accountId}`);
|
|
24
|
-
};
|
|
25
|
-
(0, data_account_1.provideAccountActionsWithCredential)(terminal, 'BINANCE', {
|
|
26
|
-
type: 'object',
|
|
27
|
-
required: ['access_key', 'secret_key'],
|
|
28
|
-
properties: {
|
|
29
|
-
access_key: { type: 'string' },
|
|
30
|
-
secret_key: { type: 'string' },
|
|
31
|
-
},
|
|
32
|
-
}, {
|
|
33
|
-
listAccounts,
|
|
34
|
-
getAccountInfo,
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=account-actions-with-credential.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account-actions-with-credential.js","sourceRoot":"","sources":["../../src/services/account-actions-with-credential.ts"],"names":[],"mappings":";;AAAA,uDAA2E;AAC3E,+CAA4C;AAE5C,gDAA2D;AAC3D,gDAA2D;AAC3D,0CAA6D;AAE7D,MAAM,QAAQ,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC;AAExC,MAAM,YAAY,GAAG,KAAK,EAAE,UAAuB,EAAE,EAAE;IACrD,MAAM,OAAO,GAAG,MAAM,IAAA,+BAAqB,EAAC,UAAU,CAAC,CAAC;IACxD,OAAO;QACL,EAAE,UAAU,EAAE,WAAW,OAAO,CAAC,GAAG,eAAe,EAAE;QACrD,EAAE,UAAU,EAAE,WAAW,OAAO,CAAC,GAAG,YAAY,EAAE;KACnD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,KAAK,EAAE,UAAuB,EAAE,SAAiB,EAAE,EAAE;IAC1E,IAAI,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QACnC,OAAO,IAAA,+BAAqB,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;KACrD;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAChC,OAAO,IAAA,iCAA0B,EAAC,UAAU,EAAE,SAAS,CAAC,CAAC;KAC1D;IACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,SAAS,EAAE,CAAC,CAAC;AAC1D,CAAC,CAAC;AAEF,IAAA,kDAAmC,EACjC,QAAQ,EACR,SAAS,EACT;IACE,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,UAAU,EAAE;QACV,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC/B;CACF,EACD;IACE,YAAY;IACZ,cAAc;CACf,CACF,CAAC","sourcesContent":["import { provideAccountActionsWithCredential } from '@yuants/data-account';\nimport { Terminal } from '@yuants/protocol';\nimport { ICredential } from '../api/private-api';\nimport { resolveAccountProfile } from './accounts/profile';\nimport { getUnifiedAccountInfo } from './accounts/unified';\nimport { getSpotAccountInfoSnapshot } from './accounts/spot';\n\nconst terminal = Terminal.fromNodeEnv();\n\nconst listAccounts = async (credential: ICredential) => {\n const profile = await resolveAccountProfile(credential);\n return [\n { account_id: `binance/${profile.uid}/unified/usdt` },\n { account_id: `binance/${profile.uid}/spot/usdt` },\n ];\n};\n\nconst getAccountInfo = async (credential: ICredential, accountId: string) => {\n if (accountId.includes('/unified/')) {\n return getUnifiedAccountInfo(credential, accountId);\n }\n if (accountId.includes('/spot/')) {\n return getSpotAccountInfoSnapshot(credential, accountId);\n }\n throw new Error(`Unsupported account_id: ${accountId}`);\n};\n\nprovideAccountActionsWithCredential<ICredential>(\n terminal,\n 'BINANCE',\n {\n type: 'object',\n required: ['access_key', 'secret_key'],\n properties: {\n access_key: { type: 'string' },\n secret_key: { type: 'string' },\n },\n },\n {\n listAccounts,\n getAccountInfo,\n },\n);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order-actions-with-credential.d.ts","sourceRoot":"","sources":["../../src/services/order-actions-with-credential.ts"],"names":[],"mappings":""}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const data_order_1 = require("@yuants/data-order");
|
|
4
|
-
const protocol_1 = require("@yuants/protocol");
|
|
5
|
-
const cancelOrder_1 = require("./orders/cancelOrder");
|
|
6
|
-
const listOrders_1 = require("./orders/listOrders");
|
|
7
|
-
const modifyOrder_1 = require("./orders/modifyOrder");
|
|
8
|
-
const submitOrder_1 = require("./orders/submitOrder");
|
|
9
|
-
const terminal = protocol_1.Terminal.fromNodeEnv();
|
|
10
|
-
(0, data_order_1.provideOrderActionsWithCredential)(terminal, 'BINANCE', {
|
|
11
|
-
type: 'object',
|
|
12
|
-
required: ['access_key', 'secret_key'],
|
|
13
|
-
properties: {
|
|
14
|
-
access_key: { type: 'string' },
|
|
15
|
-
secret_key: { type: 'string' },
|
|
16
|
-
},
|
|
17
|
-
}, {
|
|
18
|
-
submitOrder: submitOrder_1.submitOrder,
|
|
19
|
-
cancelOrder: cancelOrder_1.cancelOrder,
|
|
20
|
-
modifyOrder: modifyOrder_1.modifyOrder,
|
|
21
|
-
listOrders: listOrders_1.listOrders,
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=order-actions-with-credential.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"order-actions-with-credential.js","sourceRoot":"","sources":["../../src/services/order-actions-with-credential.ts"],"names":[],"mappings":";;AAAA,mDAAuE;AACvE,+CAA4C;AAE5C,sDAAmD;AACnD,oDAAiD;AACjD,sDAAmD;AACnD,sDAAmD;AAEnD,MAAM,QAAQ,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC;AAExC,IAAA,8CAAiC,EAC/B,QAAQ,EACR,SAAS,EACT;IACE,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,UAAU,EAAE;QACV,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC/B;CACF,EACD;IACE,WAAW,EAAX,yBAAW;IACX,WAAW,EAAX,yBAAW;IACX,WAAW,EAAX,yBAAW;IACX,UAAU,EAAV,uBAAU;CACX,CACF,CAAC","sourcesContent":["import { provideOrderActionsWithCredential } from '@yuants/data-order';\nimport { Terminal } from '@yuants/protocol';\nimport { ICredential } from '../api/private-api';\nimport { cancelOrder } from './orders/cancelOrder';\nimport { listOrders } from './orders/listOrders';\nimport { modifyOrder } from './orders/modifyOrder';\nimport { submitOrder } from './orders/submitOrder';\n\nconst terminal = Terminal.fromNodeEnv();\n\nprovideOrderActionsWithCredential<ICredential>(\n terminal,\n 'BINANCE',\n {\n type: 'object',\n required: ['access_key', 'secret_key'],\n properties: {\n access_key: { type: 'string' },\n secret_key: { type: 'string' },\n },\n },\n {\n submitOrder,\n cancelOrder,\n modifyOrder,\n listOrders,\n },\n);\n"]}
|