Skip to content

Commit 8138a13

Browse files
authored
[Components] Bitget - new components (#17685)
1 parent 9c2b86d commit 8138a13

File tree

47 files changed

+3320
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3320
-14
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import app from "../../bitget.app.mjs";
2+
3+
export default {
4+
key: "bitget-future-market-get-all-symbols-contracts",
5+
name: "Future - Market - Get All Symbols Contracts",
6+
description: "Retrieve all contract symbols by product type. [See the documentation](https://www.bitget.com/api-doc/contract/market/Get-All-Symbols-Contracts)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
productType: {
12+
propDefinition: [
13+
app,
14+
"productType",
15+
],
16+
},
17+
symbol: {
18+
propDefinition: [
19+
app,
20+
"ticker",
21+
({ productType }) => ({
22+
productType,
23+
}),
24+
],
25+
},
26+
},
27+
async run({ $ }) {
28+
const {
29+
app,
30+
symbol,
31+
productType,
32+
} = this;
33+
34+
const response = await app.getFutureMarketAllSymbolsContracts({
35+
$,
36+
params: {
37+
symbol,
38+
productType,
39+
},
40+
});
41+
42+
$.export("$summary", `Successfully retrieved all contract symbols for product type \`${productType}\``);
43+
return response;
44+
},
45+
};
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import app from "../../bitget.app.mjs";
2+
3+
export default {
4+
key: "bitget-future-market-get-candle-data",
5+
name: "Future - Market - Get Candle Data",
6+
description: "Retrieve candlestick data for a contract symbol. [See the documentation](https://www.bitget.com/api-doc/contract/market/Get-Candle-Data)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
productType: {
12+
propDefinition: [
13+
app,
14+
"productType",
15+
],
16+
},
17+
symbol: {
18+
optional: false,
19+
propDefinition: [
20+
app,
21+
"ticker",
22+
({ productType }) => ({
23+
productType,
24+
}),
25+
],
26+
},
27+
granularity: {
28+
propDefinition: [
29+
app,
30+
"kLineParticleSize",
31+
],
32+
},
33+
startTime: {
34+
propDefinition: [
35+
app,
36+
"startTime",
37+
],
38+
},
39+
endTime: {
40+
propDefinition: [
41+
app,
42+
"endTime",
43+
],
44+
},
45+
limit: {
46+
type: "integer",
47+
label: "Limit",
48+
description: "Default: `100`, maximum: `1000`",
49+
optional: true,
50+
min: 1,
51+
max: 1000,
52+
},
53+
},
54+
async run({ $ }) {
55+
const {
56+
app,
57+
symbol,
58+
productType,
59+
granularity,
60+
startTime,
61+
endTime,
62+
limit,
63+
} = this;
64+
65+
const response = await app.getFutureMarketCandleData({
66+
$,
67+
params: {
68+
symbol,
69+
productType,
70+
granularity,
71+
startTime,
72+
endTime,
73+
limit,
74+
},
75+
});
76+
77+
$.export("$summary", `Successfully retrieved candle data points for \`${symbol}\``);
78+
return response;
79+
},
80+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import app from "../../bitget.app.mjs";
2+
3+
export default {
4+
key: "bitget-future-market-get-contracts-oi",
5+
name: "Future - Market - Get Contracts OI",
6+
description: "Retrieve open interest for contracts. [See the documentation](https://www.bitget.com/api-doc/contract/market/Get-Contracts-Oi)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
productType: {
12+
propDefinition: [
13+
app,
14+
"productType",
15+
],
16+
},
17+
symbol: {
18+
propDefinition: [
19+
app,
20+
"ticker",
21+
({ productType }) => ({
22+
productType,
23+
}),
24+
],
25+
},
26+
},
27+
async run({ $ }) {
28+
const {
29+
app,
30+
symbol,
31+
productType,
32+
} = this;
33+
34+
const response = await app.getFutureMarketContractsOi({
35+
$,
36+
params: {
37+
symbol,
38+
productType,
39+
},
40+
});
41+
42+
$.export("$summary", `Successfully retrieved contracts open interest for \`${symbol}\``);
43+
return response;
44+
},
45+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import app from "../../bitget.app.mjs";
2+
3+
export default {
4+
key: "bitget-future-market-get-current-funding-rate",
5+
name: "Future - Market - Get Current Funding Rate",
6+
description: "Retrieve current funding rate for a contract symbol. [See the documentation](https://www.bitget.com/api-doc/contract/market/Get-Current-Funding-Rate)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
productType: {
12+
propDefinition: [
13+
app,
14+
"productType",
15+
],
16+
},
17+
symbol: {
18+
propDefinition: [
19+
app,
20+
"ticker",
21+
({ productType }) => ({
22+
productType,
23+
}),
24+
],
25+
},
26+
},
27+
async run({ $ }) {
28+
const {
29+
app,
30+
symbol,
31+
productType,
32+
} = this;
33+
34+
const response = await app.getFutureMarketCurrentFundingRate({
35+
$,
36+
params: {
37+
symbol,
38+
productType,
39+
},
40+
});
41+
42+
$.export("$summary", `Successfully retrieved current funding rate for \`${symbol}\``);
43+
return response;
44+
},
45+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import app from "../../bitget.app.mjs";
2+
3+
export default {
4+
key: "bitget-future-market-get-discount-rate",
5+
name: "Future - Market - Get Discount Rate",
6+
description: "Retrieve discount rate information for contract trading. [See the documentation](https://www.bitget.com/api-doc/contract/market/Get-Discount-Rate)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
},
12+
async run({ $ }) {
13+
const response = await this.app.getFutureMarketDiscountRate({
14+
$,
15+
});
16+
17+
$.export("$summary", `Successfully retrieved discount rate information with \`${response?.data?.length}\` record(s)`);
18+
return response;
19+
},
20+
};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import app from "../../bitget.app.mjs";
2+
3+
export default {
4+
key: "bitget-future-market-get-exchange-rate",
5+
name: "Future - Market - Get Exchange Rate",
6+
description: "Get interest exchange rate information for contract trading. [See the documentation](https://www.bitget.com/api-doc/contract/market/Get-Exchange-Rate)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
},
12+
async run({ $ }) {
13+
const response = await this.app.getFutureMarketExchangeRate({
14+
$,
15+
});
16+
17+
$.export("$summary", `Successfully retrieved exchange rate information with \`${response?.data?.length}\` record(s)`);
18+
return response;
19+
},
20+
};
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import app from "../../bitget.app.mjs";
2+
3+
export default {
4+
key: "bitget-future-market-get-fills-history",
5+
name: "Future - Market - Get Fills History",
6+
description: "Retrieve historical fill data for a contract symbol. [See the documentation](https://www.bitget.com/api-doc/contract/market/Get-Fills-History)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
productType: {
12+
propDefinition: [
13+
app,
14+
"productType",
15+
],
16+
},
17+
symbol: {
18+
optional: false,
19+
propDefinition: [
20+
app,
21+
"ticker",
22+
({ productType }) => ({
23+
productType,
24+
}),
25+
],
26+
},
27+
limit: {
28+
type: "integer",
29+
label: "Limit",
30+
description: "Default: `500`, maximum: `1000`",
31+
optional: true,
32+
min: 1,
33+
max: 1000,
34+
},
35+
startTime: {
36+
propDefinition: [
37+
app,
38+
"startTime",
39+
],
40+
},
41+
endTime: {
42+
propDefinition: [
43+
app,
44+
"endTime",
45+
],
46+
},
47+
},
48+
async run({ $ }) {
49+
const {
50+
app,
51+
symbol,
52+
productType,
53+
limit,
54+
startTime,
55+
endTime,
56+
} = this;
57+
58+
const response = await app.getFutureMarketFillsHistory({
59+
$,
60+
params: {
61+
symbol,
62+
productType,
63+
limit,
64+
startTime,
65+
endTime,
66+
},
67+
});
68+
69+
$.export("$summary", `Successfully retrieved ${response?.data?.length || 0} historical fills for ${symbol}`);
70+
return response;
71+
},
72+
};

0 commit comments

Comments
 (0)