Skip to content

Commit 0069b2d

Browse files
Merge pull request #41 from InjectiveLabs/f/add_skip_limit_params
Add skip & limit to Exchange API Requests
2 parents dee14c4 + a26acb4 commit 0069b2d

File tree

18 files changed

+1596
-1987
lines changed

18 files changed

+1596
-1987
lines changed

examples/exchange/accounts/5_SubaccountHistory/example.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ func main() {
2121
denom := "inj"
2222
subaccountId := "0xaf79152ac5df276d9a8e1e2e22822f9713474902000000000000000000000000"
2323
transferTypes := []string{"deposit"}
24+
skip := uint64(0)
25+
limit := int32(10)
2426

2527
req := accountPB.SubaccountHistoryRequest{
2628
Denom: denom,
2729
SubaccountId: subaccountId,
2830
TransferTypes: transferTypes,
31+
Skip: skip,
32+
Limit: limit,
2933
}
3034

3135
res, err := exchangeClient.GetSubaccountHistory(ctx, req)

examples/exchange/derivatives/13_SubaccountOrdersList/example.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ func main() {
2020
ctx := context.Background()
2121
marketId := "0x4ca0f92fc28be0c9761326016b5a1a2177dd6375558365116b5bdda9abc229ce"
2222
subaccountId := "0xaf79152ac5df276d9a8e1e2e22822f9713474902000000000000000000000000"
23+
skip := uint64(0)
24+
limit := int32(10)
2325

2426
req := derivativeExchangePB.SubaccountOrdersListRequest{
2527
MarketId: marketId,
2628
SubaccountId: subaccountId,
29+
Skip: skip,
30+
Limit: limit,
2731
}
2832

2933
res, err := exchangeClient.GetSubaccountDerivativeOrdersList(ctx, req)

examples/exchange/derivatives/14_SubaccountTradesList/example.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ func main() {
2020
ctx := context.Background()
2121
marketId := "0x4ca0f92fc28be0c9761326016b5a1a2177dd6375558365116b5bdda9abc229ce"
2222
subaccountId := "0xaf79152ac5df276d9a8e1e2e22822f9713474902000000000000000000000000"
23+
skip := uint64(0)
24+
limit := int32(10)
2325

2426
req := derivativeExchangePB.SubaccountTradesListRequest{
2527
MarketId: marketId,
2628
SubaccountId: subaccountId,
29+
Skip: skip,
30+
Limit: limit,
2731
}
2832

2933
res, err := exchangeClient.GetSubaccountDerivativeTradesList(ctx, req)

examples/exchange/derivatives/6_Orders/example.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ func main() {
1919

2020
ctx := context.Background()
2121
marketId := "0x4ca0f92fc28be0c9761326016b5a1a2177dd6375558365116b5bdda9abc229ce"
22+
skip := uint64(0)
23+
limit := int32(10)
2224

2325
req := derivativeExchangePB.OrdersRequest{
2426
MarketId: marketId,
27+
Skip: skip,
28+
Limit: limit,
2529
}
2630

2731
res, err := exchangeClient.GetDerivativeOrders(ctx, req)

examples/exchange/derivatives/7_Positions/example.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ func main() {
2020
ctx := context.Background()
2121
marketId := "0x4ca0f92fc28be0c9761326016b5a1a2177dd6375558365116b5bdda9abc229ce"
2222
subaccountId := "0xc6fe5d33615a1c52c08018c47e8bc53646a0e101000000000000000000000000"
23+
skip := uint64(0)
24+
limit := int32(10)
2325

2426
req := derivativeExchangePB.PositionsRequest{
2527
MarketId: marketId,
2628
SubaccountId: subaccountId,
29+
Skip: skip,
30+
Limit: limit,
2731
}
2832

2933
res, err := exchangeClient.GetDerivativePositions(ctx, req)

examples/exchange/spot/10_SubaccountOrdersList/example.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ func main() {
2020
ctx := context.Background()
2121
marketId := "0xa508cb32923323679f29a032c70342c147c17d0145625922b0ef22e955c844c0"
2222
subaccountId := "0x0b46e339708ea4d87bd2fcc61614e109ac374bbe000000000000000000000000"
23+
skip := uint64(0)
24+
limit := int32(10)
2325

2426
req := spotExchangePB.SubaccountOrdersListRequest{
2527
MarketId: marketId,
2628
SubaccountId: subaccountId,
29+
Skip: skip,
30+
Limit: limit,
2731
}
2832

2933
res, err := exchangeClient.GetSubaccountSpotOrdersList(ctx, req)

examples/exchange/spot/11_SubaccountTradesList/example.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ func main() {
2020
ctx := context.Background()
2121
marketId := "0xa508cb32923323679f29a032c70342c147c17d0145625922b0ef22e955c844c0"
2222
subaccountId := "0xc6fe5d33615a1c52c08018c47e8bc53646a0e101000000000000000000000000"
23+
skip := uint64(0)
24+
limit := int32(10)
2325

2426
req := spotExchangePB.SubaccountTradesListRequest{
2527
MarketId: marketId,
2628
SubaccountId: subaccountId,
29+
Skip: skip,
30+
Limit: limit,
2731
}
2832

2933
res, err := exchangeClient.GetSubaccountSpotTradesList(ctx, req)

examples/exchange/spot/5_Orders/example.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ func main() {
1919

2020
ctx := context.Background()
2121
marketId := "0xa508cb32923323679f29a032c70342c147c17d0145625922b0ef22e955c844c0"
22+
skip := uint64(0)
23+
limit := int32(10)
2224

2325
req := spotExchangePB.OrdersRequest{
2426
MarketId: marketId,
27+
Skip: skip,
28+
Limit: limit,
2529
}
2630

2731
res, err := exchangeClient.GetSpotOrders(ctx, req)

exchange/accounts_rpc/pb/injective_accounts_rpc.pb.go

Lines changed: 166 additions & 145 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exchange/accounts_rpc/pb/injective_accounts_rpc.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ message SubaccountHistoryRequest {
175175
string denom = 2;
176176
// Filter history by transfer type
177177
repeated string transfer_types = 3;
178+
// Skip will skip the first n item from the result
179+
uint64 skip = 4;
180+
// Limit is used to specify the maximum number of items to be returned
181+
sint32 limit = 5;
178182
}
179183

180184
message SubaccountHistoryResponse {

0 commit comments

Comments
 (0)