Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gateio] minor: improve http requests #4977

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion xchange-gateio-v4/src/test/resources/rest/sign.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export function gen_sign(method, request) {
export function gen_sign(request) {
const method = request.method
const pattern = RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?");
const url = request.url.tryGetSubstituted();
const matches = url.match(pattern);
Expand Down
14 changes: 7 additions & 7 deletions xchange-gateio-v4/src/test/resources/rest/spot.http
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### List personal trading history
< {%
import {gen_sign} from 'sign.js'
gen_sign("GET", request);
gen_sign(request);
%}

GET {{api_v4}}/spot/my_trades
Expand All @@ -14,7 +14,7 @@ Content-Type: application/json
### List spot accounts
< {%
import {gen_sign} from 'sign.js'
gen_sign("GET", request);
gen_sign(request);
%}

GET {{api_v4}}/spot/accounts
Expand All @@ -27,7 +27,7 @@ Content-Type: application/json
### Query account book
< {%
import {gen_sign} from 'sign.js'
gen_sign("GET", request);
gen_sign(request);
%}

GET {{api_v4}}/spot/account_book
Expand All @@ -40,7 +40,7 @@ Content-Type: application/json
### List orders
< {%
import {gen_sign} from 'sign.js'
gen_sign("GET", request);
gen_sign(request);
%}

GET {{api_v4}}/spot/orders?currency_pair=VAI_USDT&status=finished
Expand All @@ -53,7 +53,7 @@ Content-Type: application/json
### Create an order
< {%
import {gen_sign} from 'sign.js'
gen_sign("POST", request);
gen_sign(request);
%}

POST {{api_v4}}/spot/orders
Expand All @@ -74,7 +74,7 @@ Content-Type: application/json
### Cancel a single order
< {%
import {gen_sign} from 'sign.js'
gen_sign("DELETE", request);
gen_sign(request);
%}

DELETE {{api_v4}}/spot/orders/123456?currency_pair=BTC_USDT
Expand All @@ -87,7 +87,7 @@ Content-Type: application/json
### Get a single order
< {%
import {gen_sign} from 'sign.js'
gen_sign("GET", request);
gen_sign(request);
%}

GET {{api_v4}}/spot/orders/745504484392?currency_pair=BTC_USDT
Expand Down
4 changes: 2 additions & 2 deletions xchange-gateio-v4/src/test/resources/rest/wallet.http
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Retrieve withdrawal status
< {%
import {gen_sign} from 'sign.js'
gen_sign("GET", request);
gen_sign(request);
%}

GET {{api_v4}}/wallet/withdraw_status?currency=usdt
Expand All @@ -14,7 +14,7 @@ Content-Type: application/json
### Retrieve transfer records between main and sub accounts
< {%
import {gen_sign} from 'sign.js'
gen_sign("GET", request);
gen_sign(request);
%}

GET {{api_v4}}/wallet/sub_account_transfers
Expand Down
2 changes: 1 addition & 1 deletion xchange-gateio-v4/src/test/resources/rest/withdraw.http
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Withdraw
< {%
import {gen_sign} from 'sign.js'
gen_sign("POST", request);
gen_sign(request);
%}

POST {{api_v4}}/withdrawals
Expand Down
Loading