feat(TS): add more types and stub methods [ci deploy]
diff --git a/build/export-exchanges.js b/build/export-exchanges.js
index 9b85ede25ea4..51bdf56c0f2c 100644
--- a/build/export-exchanges.js
+++ b/build/export-exchanges.js
@@ -409,7 +409,7 @@ async function exportEverything () {
     const flat = flatten (errorHierarchy['default'])
     flat.push ('error_hierarchy')
 
-    const typeExports = ['Market', 'Trade' , 'Fee', 'Ticker', 'OrderBook', 'Order', 'Transaction', 'Tickers', 'Currency', 'Balance', 'DepositAddress', 'WithdrawalResponse', 'DepositAddressResponse', 'OHLCV' ]
+    const typeExports = ['Market', 'Trade' , 'Fee', 'Ticker', 'OrderBook', 'Order', 'Transaction', 'Tickers', 'Currency', 'Balance', 'DepositAddress', 'WithdrawalResponse', 'DepositAddressResponse', 'OHLCV', 'Balances', 'PartialBalances' ]
     const staticExports = ['version', 'Exchange', 'exchanges', 'pro', 'Precise', 'functions', 'errors'].concat(typeExports)
 
     const fullExports  = staticExports.concat(ids)
diff --git a/examples/ts/fetch-orderbook.ts b/examples/ts/fetch-orderbook.ts
new file mode 100644
index 000000000000..28d4fbd1902b
--- /dev/null
+++ b/examples/ts/fetch-orderbook.ts
@@ -0,0 +1,12 @@
+import { binance } from '../../ts/ccxt.js'
+
+async function main() {
+    const exchange = new binance();
+    const ob = await exchange.fetchOrderBook('BTC/USDT')
+    const asks = ob.asks;
+    const bids = ob.bids;
+    console.log(asks);
+    console.log(bids);
+}
+
+main();
\ No newline at end of file
diff --git a/ts/ccxt.ts b/ts/ccxt.ts
index 2d991d7f7aad..668d518568aa 100644
--- a/ts/ccxt.ts
+++ b/ts/ccxt.ts
@@ -33,7 +33,7 @@ import { Exchange }  from './src/base/Exchange.js'
 import { Precise }   from './src/base/Precise.js'
 import * as functions from './src/base/functions.js'
 import * as errors   from './src/base/errors.js'
-import { Market, Trade , Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV } from './src/base/types.js'
+import { Market, Trade , Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances } from './src/base/types.js'
 
 //-----------------------------------------------------------------------------
 // this is updated by vss.js when building
diff --git a/ts/src/base/Exchange.ts b/ts/src/base/Exchange.ts
index 7a5d02d68baf..824cc3f5367e 100644
--- a/ts/src/base/Exchange.ts
+++ b/ts/src/base/Exchange.ts
@@ -138,13 +138,13 @@ import { Precise } from './Precise.js'
 //-----------------------------------------------------------------------------
 import WsClient from './ws/WsClient.js';
 import Future from './ws/Future.js';
-import { OrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
+import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
 
 // ----------------------------------------------------------------------------
 //
 
 // import types
-import {Market, Trade, Fee, Ticker, OHLCV, Order} from './types'
+import {Market, Trade, Fee, Ticker, OHLCV, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse } from './types'
 export {Market, Trade, Fee, Ticker} from './types'
 
 
@@ -987,7 +987,7 @@ export default class Exchange {
         return this.setMarkets (markets, currencies)
     }
 
-    loadMarkets (reload = false, params = {}) {
+    loadMarkets (reload = false, params = {}): Promise<Dictionary<Market>> {
         // this method is async, it returns a promise
         if ((reload && !this.reloadingMarkets) || !this.marketsLoading) {
             this.reloadingMarkets = true
@@ -1204,6 +1204,18 @@ export default class Exchange {
             return undefined;
         }
 
+        async transfer (code: string, amount, fromAccount, toAccount, params = {}) {
+            return undefined;
+        }
+
+        async withdraw(code: string, amount, address, tag = undefined, params = {}) {
+            return undefined;
+        }
+
+        async createDepositAddress (code, params = {}): Promise<DepositAddressResponse>{
+            return undefined;
+        }
+
         findTimeframe (timeframe, timeframes = undefined) {
             timeframes = timeframes || this.timeframes;
             const keys = Object.keys (timeframes);
@@ -1240,7 +1252,7 @@ export default class Exchange {
     // WS/PRO methods
 
     orderBook (snapshot = {}, depth = Number.MAX_SAFE_INTEGER) {
-        return new OrderBook (snapshot, depth);
+        return new WsOrderBook (snapshot, depth);
     }
 
     indexedOrderBook (snapshot = {}, depth = Number.MAX_SAFE_INTEGER) {
@@ -1612,7 +1624,7 @@ export default class Exchange {
         return this.markets;
     }
 
-    safeBalance (balance: object) {
+    safeBalance (balance: object): Balances {
         const balances = this.omit (balance, [ 'info', 'timestamp', 'datetime', 'free', 'used', 'total' ]);
         const codes = Object.keys (balances);
         balance['free'] = {};
@@ -1650,7 +1662,7 @@ export default class Exchange {
         if (length) {
             balance['debt'] = debtBalance;
         }
-        return balance;
+        return balance as any;
     }
 
     safeOrder (order: object, market: object = undefined) {
@@ -2905,7 +2917,7 @@ export default class Exchange {
         }
     }
 
-    async fetchBalance (params = {}): Promise<any> {
+    async fetchBalance (params = {}): Promise<Balances> {
         throw new NotSupported (this.id + ' fetchBalance() is not supported yet');
     }
 
@@ -3209,7 +3221,7 @@ export default class Exchange {
         }
     }
 
-    account () {
+    account (): Balance {
         return {
             'free': undefined,
             'used': undefined,
@@ -3274,27 +3286,27 @@ export default class Exchange {
         return [ tag, params ];
     }
 
-    async createLimitOrder (symbol: string, side: string, amount, price, params = {}) {
+    async createLimitOrder (symbol: string, side: string, amount, price, params = {}): Promise<Order> {
         return await this.createOrder (symbol, 'limit', side, amount, price, params);
     }
 
-    async createMarketOrder (symbol: string, side: string, amount, price = undefined, params = {}) {
+    async createMarketOrder (symbol: string, side: string, amount, price = undefined, params = {}): Promise<Order> {
         return await this.createOrder (symbol, 'market', side, amount, price, params);
     }
 
-    async createLimitBuyOrder (symbol: string, amount, price, params = {}) {
+    async createLimitBuyOrder (symbol: string, amount, price, params = {}): Promise<Order> {
         return await this.createOrder (symbol, 'limit', 'buy', amount, price, params);
     }
 
-    async createLimitSellOrder (symbol: string, amount, price, params = {}) {
+    async createLimitSellOrder (symbol: string, amount, price, params = {}): Promise<Order> {
         return await this.createOrder (symbol, 'limit', 'sell', amount, price, params);
     }
 
-    async createMarketBuyOrder (symbol: string, amount, params = {}) {
+    async createMarketBuyOrder (symbol: string, amount, params = {}): Promise<Order> {
         return await this.createOrder (symbol, 'market', 'buy', amount, undefined, params);
     }
 
-    async createMarketSellOrder (symbol: string, amount, params = {}) {
+    async createMarketSellOrder (symbol: string, amount, params = {}): Promise<Order> {
         return await this.createOrder (symbol, 'market', 'sell', amount, undefined, params);
     }
 
diff --git a/ts/src/base/types.ts b/ts/src/base/types.ts
index e41220fc7567..4a96855de0b0 100644
--- a/ts/src/base/types.ts
+++ b/ts/src/base/types.ts
@@ -1,4 +1,4 @@
-interface Dictionary<T> {
+export interface Dictionary<T> {
     [key: string]: T;
 }
 /** Request parameters */
@@ -154,9 +154,9 @@ export interface Currency {
 }
 
 export interface Balance {
-    free: number;
-    used: number;
-    total: number;
+    free: number | string;
+    used: number | string;
+    total: number | string;
 }
 
 export interface PartialBalances extends Dictionary<number> {
