All notable changes to this project will be documented in this file.
-
all functions with the userId/traderId as an input now accepts:
- hex string with
0x
prefix; - hex string of 64 char length without
0x
prefix; - decimal string.
- hex string with
-
Trader.deployEverWallet
accepts token parameters asTokenValue
instead ofnumber
's. -
Changed contract errors: " failed with exit code . .".
-
Replaced
number
withstring
andTokenValue
in SDK parameters and results.
queryPrice
hided server errorsqueryOrders
does not returntraderId
andfinishTime
-
Waiting for derivative transaction was stopped: account **** has inactive state 3." STDERR: "TypeError: Cannot read properties of null (reading 'toString') at errorFromExitCode (node_modules/flex-sdk-js/dist/contracts/errors.js:9:90) at findTransactionError (node_modules/flex-sdk-js/dist/contracts/errors.js:42:19) at resolveDerivativeTransaction (node_modules/flex-sdk-js/dist/flex/trader/processing.js:19:60) at node_modules/flex-sdk-js/dist/flex/trader/cancel-order.js:177:80```
- Integration tests.
Trader.cancelAllOrders
- cancels all orders for the specified trader.
Client.getClientInfo
- shows Flex Client contract's balance.Trader.getIndexInfo
- shows User Index contract's address and balanceTrader.topUp
,Trader.getTopUpInfo
- tops up and calculates the topup value for Trader's wallets and UserIndex contract
- decimal string in token value. E.g "1234567890123456789.1234".
- waiting for the derivative transactions was going into infinite loop if the shard had been stopped.
- additional logic to detect errors during making/canceling of orders
- optimization for first step of the makeOrder and cancelOrder
-
ABI 2.3 Flex Contracts version was supported.
-
makeOrder
andcancelOrder
now returns additionalstatus
field of typeenum MakeOrderStatus
representing the processing stage of the request. Can be of [STARTING
,FINALIZING
,SUCCESS
,ERROR
]. -
In case of
FINALIZING
status returned can be proceeded to the final result withwaitForMakeOrder
andwaitForCancelOrder
functions. Just pass the result ofmakeOrder
/cancelOrder
as the input parameter.Attention!!!!
ERROR
status means the error occurred in the contract system, which means you SHOULD NOT perform retries until you solve the error reason.- Network errors are not resolved by
makeOrder
/cancelOrder
methods. Wrap your code intry catch
for network errors. In case of network error we suggest you to query trader info from the api to understand your state. See/examples/trader-info.ts
sample
- Added flex client balance check before trader Index Contract deploy to the
deployTrader
.
- If non-existing signer was specified then empty error message was printed.
- make-order did not finish process in case of a full order closure.
Trader.cancelOrder
andTrader.makeOrder
now work in 2 modes, defined bywaitForOrderbookUpdate
flag. Iffalse
, the functions return only 1st transaction that initiated the operation. Iftrue
- return also the second transaction that actually processed the operation, after which the orderbook is updated.
Trader.cancelOrder
andTrader.makeOrder
now accept price and amount also in units. See the documentation and tests for more info.
Trader.cancelOrder
now returns transactionID
- Contracts updated to the last version (commit bb3ec9320b130174e57142c492b90bf092fa6e25)
- Ever deposit fixed:
Trader.deployTraderEverWallet
function now usesWrapperEverAccount
ABI instead ofWrapperAccount
- Ever deposit
Trader.deployTraderEverWallet
does not perform an additional top-up any more
- Code refactoring. Only TS files left in the root folders. Build the library with
nmp run build
to get the entire build in thedist
folder. Run examples fromdist/examples
folder.
Trader.makeOrder(...)
now returnsorderId
andtransactionId
fields
- Random generator is now used to generate order IDs instead of current timestamp.