|
13 | 13 | currency.SHFT: 84, |
14 | 14 | TotalIn float64 `json:"totalIn"` |
15 | 15 | TotalIn int64 `json:"totalIn"` |
| 16 | + behavior: default |
| 17 | + loanCustomiseMarginCall = "/sapi/v1/loan/customize/margin_call" |
| 18 | + assert.ErrorIs(t, b.StartPortfolioWatcher(ctx, 0), context.Canceled, "StartPortfolioWatcher should return context.Canceled") |
| 19 | + assert.ErrorIs(t, <-doneCh, context.Canceled, "StartPortfolioWatcher should return a context cancelled error") |
| 20 | + {Case: "CANCELED", Result: order.Cancelled}, |
| 21 | + case "CANCELED": |
| 22 | + if algoOrderID == "" && !slices.Contains([]string{"effective", "order_failed", "canceled"}, state) { |
| 23 | +// GetCompletedSpreadOrdersLast7Days retrieve the completed order data for the last 7 days, and the incomplete orders (filledSz =0 & state = canceled) that have been cancelled are only reserved for 2 hours. Results are returned in counter chronological order |
| 24 | + "70200": errors.New("the RFQ with {0} status cannot be canceled"), |
| 25 | + "70400": errors.New("the quote with {0} status cannot be canceled"), |
| 26 | + "58220": errors.New("the withdrawal order is already canceled"), |
| 27 | + "51401": errors.New("cancellation failed as the order is already canceled"), |
| 28 | + "51406": errors.New("canceled - order count exceeds the limit {0}"), |
| 29 | + "51509": errors.New("modification failed as the order has been canceled"), |
| 30 | + result, err := e.GetCompletedSpreadOrdersLast7Days(contextGenerate(), "", "limit", "canceled", "", "", time.Time{}, time.Time{}, 10) |
| 31 | + {Case: "canceled", Result: order.Cancelled}, |
| 32 | + case "canceled": |
| 33 | + states := "partial-canceled,filled,canceled" |
| 34 | + require.ErrorIs(t, err, context.Canceled) |
| 35 | + case "CANCELED", "CANCELLED": |
| 36 | + "status": "canceled", |
| 37 | + "reportType": "canceled" |
| 38 | + Status string `json:"status"` // new, suspended, partiallyFilled, filled, canceled, expired |
| 39 | + case "replaced", "canceled", "new": |
| 40 | + o.Status = strings.Replace(o.Status, "canceled", "cancelled", 1) |
| 41 | + if resp[i].Status != "canceled" { |
| 42 | + "CANCELED": order.Cancelled, |
| 43 | + Status: "CANCELED", |
| 44 | + case PartiallyCancelled.String(), "PARTIAL-CANCELED", "PARTIALLY CANCELLED", "ORDER_PARTIALLY_TRANSACTED": |
| 45 | + case Cancelled.String(), "CANCELED", "ORDER_CANCELLED": |
| 46 | + assert.ErrorIs(t, err, context.Canceled, "should return correct error when context is cancelled") |
| 47 | + require.ErrorIs(t, err, context.Canceled, "must return error when context is cancelled") |
| 48 | + Type string `json:"type"` // Message Type: "open", "match", "filled", "canceled", "update" |
| 49 | + case "partial-canceled": |
| 50 | + {Case: "partial-canceled", Result: order.PartiallyCancelled}, |
| 51 | + withdrawal := []byte(`[13293039,"ETH","ETHEREUM",null,null,1574175052000,1574181326000,null,null,"CANCELED",null,null,-0.24,-0.00135,null,null,"DESTINATION_ADDRESS",null,null,null,"TRANSACTION_ID","Purchase of 100 pizzas"]`) |
| 52 | + pressXToJSON = `[0,"oc",[34930659963,null,1574955083558,"tETHUSD",1574955083558,1574955354487,0.201104,0.201104,"EXCHANGE LIMIT",null,null,null,0,"CANCELED",null,null,120,0,0,0,null,null,null,0,0,null,null,null,"BFX",null,null,null]]` |
| 53 | + "Quotes": `{"arg": {"channel":"quotes"},"data":[{"validUntil":"1608997227854","uTime":"1608267227834","cTime":"1608267227834","legs":[{"px":"0.0023","sz":"25.0","instId":"BTC-USD-220114-25000-C","side":"sell","tgtCcy":""},{"px":"0.0045","sz":"25","instId":"BTC-USD-220114-35000-C","side":"buy","tgtCcy":""}],"quoteId":"25092","rfqId":"18753","traderCode":"SATS","quoteSide":"sell","state":"canceled","clQuoteId":""}]}`, |
0 commit comments