Skip to content
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
2 changes: 1 addition & 1 deletion js/ccxt.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
import * as errors from './src/base/errors.js';
import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './src/base/types.js';
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
declare const version = "0.0.12";
declare const version = "0.0.13";
import alpaca from './src/alpaca.js';
import apex from './src/apex.js';
import ascendex from './src/ascendex.js';
Expand Down
2 changes: 1 addition & 1 deletion js/ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
//-----------------------------------------------------------------------------
// this is updated by vss.js when building
const version = '0.0.12';
const version = '0.0.13';
Exchange.ccxtVersion = version;
//-----------------------------------------------------------------------------
import alpaca from './src/alpaca.js';
Expand Down
1 change: 1 addition & 0 deletions js/src/abstract/mexc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface Exchange {
spotPrivateGetAccount(params?: {}): Promise<implicitReturnType>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this existing function not work?

Maybe run a check to determine what the TLS Proof outcome is for this function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i couldn't justify saving 100 times the data need and sending that to zkvm when an api exist with just what we need
https://www.mexc.com/api-docs/spot-v3/spot-account-trade#query-uid

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair.

spotPrivateGetMyTrades(params?: {}): Promise<implicitReturnType>;
spotPrivateGetTradeFee(params?: {}): Promise<implicitReturnType>;
spotPrivateGetUid(params?: {}): Promise<implicitReturnType>;
spotPrivateGetSubAccountList(params?: {}): Promise<implicitReturnType>;
spotPrivateGetSubAccountApiKey(params?: {}): Promise<implicitReturnType>;
spotPrivateGetCapitalConfigGetall(params?: {}): Promise<implicitReturnType>;
Expand Down
4 changes: 4 additions & 0 deletions js/src/base/Exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ const urlToMethodMap = {
"https://contract.mexc.com/api/v1/contract/funding_rate/": "fetchFundingInterval",
"https://contract.mexc.com/api/v1/private/position/list/history_positions": "fetchPositionsHistory",
"https://api.mexc.com/api/v3/capital/withdraw": "withdraw",
"https://api.mexc.com/api/v3/uid": "fetchAccountId",
"https://contract.mexc.com/api/v1/private/position/change_leverage": "setMarginMode"
},
"onetrading": {
Expand Down Expand Up @@ -1144,6 +1145,7 @@ const urlToMethodMap = {
"https://testnet.binancefuture.com/sapi/v1/lending/union/account": "fetchBalance",
"https://testnet.binancefuture.com/sapi/v1/asset/get-funding-asset": "fetchBalance",
"https://api.binance.com/sapi/v1/margin/isolated/account": "fetchBalance",
"https://api.binance.com/api/v5/user/query-api": "fetchAccountId",
"https://papi.binance.com/papi/v1/balance": "fetchBalance",
"https://api.binance.com/api/v3/myTrades": "fetchOrderTrades",
"https://testnet.binancefuture.com/fapi/v1/userTrades": "fetchMyTrades",
Expand Down Expand Up @@ -1571,6 +1573,8 @@ const urlToMethodMap = {
"https://api-testnet.bybit.com/v5/market/open-interest": "fetchOpenInterest",
"https://api-testnet.bybit.com/v5/asset/deposit/query-address": "fetchDepositAddressesByNetwork",
"https://api.bybit.com/v5/asset/deposit/query-address": "fetchDepositAddressesByNetwork",
"https://api.bybit.com/v5/user/query-api": "fetchAccountId",
"https://api-testnet.bybit.com/v5/user/query-api": "fetchAccountId",
},
"cryptomus": {
"https://api.cryptomus.com/v2/user-api/exchange/account/tariffs": "fetchTradingFees",
Expand Down
1 change: 1 addition & 0 deletions js/src/mexc.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export default class mexc extends Exchange {
'account': 10,
'myTrades': 10,
'tradeFee': 10,
'uid': 1,
'sub-account/list': 1,
'sub-account/apiKey': 1,
'capital/config/getall': 10,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@usherlabs/ccxt",
"version": "0.0.12",
"version": "0.0.13",
"description": "A JavaScript cryptocurrency trading library with support for 100+ exchanges + optional Verity zkTLS proof of data source.",
"unpkg": "dist/ccxt.browser.min.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion ts/ccxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {BaseError, ExchangeError, AuthenticationError, PermissionDenied, Account
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '0.0.12';
const version = '0.0.13';

(Exchange as any).ccxtVersion = version

Expand Down
1 change: 1 addition & 0 deletions ts/src/abstract/mexc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface Exchange {
spotPrivateGetAccount (params?: {}): Promise<implicitReturnType>;
spotPrivateGetMyTrades (params?: {}): Promise<implicitReturnType>;
spotPrivateGetTradeFee (params?: {}): Promise<implicitReturnType>;
spotPrivateGetUid (params?: {}): Promise<implicitReturnType>;
spotPrivateGetSubAccountList (params?: {}): Promise<implicitReturnType>;
spotPrivateGetSubAccountApiKey (params?: {}): Promise<implicitReturnType>;
spotPrivateGetCapitalConfigGetall (params?: {}): Promise<implicitReturnType>;
Expand Down
13 changes: 8 additions & 5 deletions ts/src/base/Exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ const urlToMethodMap = {
"https://contract.mexc.com/api/v1/contract/funding_rate/": "fetchFundingInterval",
"https://contract.mexc.com/api/v1/private/position/list/history_positions": "fetchPositionsHistory",
"https://api.mexc.com/api/v3/capital/withdraw": "withdraw",
"https://api.mexc.com/api/v3/uid": "fetchAccountId",
"https://contract.mexc.com/api/v1/private/position/change_leverage": "setMarginMode"
},
"onetrading": {
Expand Down Expand Up @@ -1312,6 +1313,7 @@ const urlToMethodMap = {
"https://testnet.binancefuture.com/sapi/v1/lending/union/account": "fetchBalance",
"https://testnet.binancefuture.com/sapi/v1/asset/get-funding-asset": "fetchBalance",
"https://api.binance.com/sapi/v1/margin/isolated/account": "fetchBalance",
"https://api.binance.com/api/v5/user/query-api": "fetchAccountId",
"https://papi.binance.com/papi/v1/balance": "fetchBalance",
"https://api.binance.com/api/v3/myTrades": "fetchOrderTrades",
"https://testnet.binancefuture.com/fapi/v1/userTrades": "fetchMyTrades",
Expand Down Expand Up @@ -1739,7 +1741,8 @@ const urlToMethodMap = {
"https://api-testnet.bybit.com/v5/market/open-interest": "fetchOpenInterest",
"https://api-testnet.bybit.com/v5/asset/deposit/query-address": "fetchDepositAddressesByNetwork",
"https://api.bybit.com/v5/asset/deposit/query-address": "fetchDepositAddressesByNetwork",

"https://api.bybit.com/v5/user/query-api": "fetchAccountId",
"https://api-testnet.bybit.com/v5/user/query-api": "fetchAccountId",
},
"cryptomus": {
"https://api.cryptomus.com/v2/user-api/exchange/account/tariffs": "fetchTradingFees",
Expand Down Expand Up @@ -3157,13 +3160,13 @@ export default class Exchange {
const path = url.split("?")[0];
const idMap = urlToMethodMap[this.id] ?? {};

const matchedEntry:any = Object.entries(idMap).find(([prefix]) =>
path.startsWith(prefix)
const matchedEntry: any = Object.entries(idMap).find(([prefix]) =>
path.startsWith(prefix)
);

const methodCalled:string = matchedEntry?.[1] ?? "";
const methodCalled: string = matchedEntry?.[1] ?? "";
if (this.verbose) {
this.log("MethodCalled:", methodCalled+ "\n");
this.log("MethodCalled:", methodCalled + "\n");
}


Expand Down
1 change: 1 addition & 0 deletions ts/src/mexc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export default class mexc extends Exchange {
'account': 10,
'myTrades': 10,
'tradeFee': 10,
'uid': 1,
'sub-account/list': 1,
'sub-account/apiKey': 1,
'capital/config/getall': 10,
Expand Down