TS SDK
Additions and updates to the TS SDK
May 19, 2024 - v1.5.4
Update
Updates to @orderly.network/hook v1.5.4
Adding component IDs to component SDK for more customization options.
May 17, 2024 - v1.5.3
Bug Fixes
Updates to @orderly.network/hook v1.5.3
Bug fixes.
May 16, 2024 - v1.5.2
Bug Fixes
Updates to @orderly.network/hook v1.5.2
Bug fixes.
May 15, 2024 - v1.5.1
Bug Fixes
Updates to @orderly.network/hook v1.5.1
Bug fixes
New Feature
Updates to @orderly.network/hook v1.5.1
- The SDK now supports the use order/position line features, even when using the free Advanced TradingView version.
TradingView v27^ is required to integrate hoooks v1.5.0^
April 29, 2024 - v1.4.3
Update
Updates to @orderly.network/hook v1.4.3
Fixes for some production bugs related to TP/SL, referral and PnL card sharing.
Referral hooks are now a part of the hooks package.
April 26, 2024 - v1.4.0
New Feature
Updates to @orderly.network/hook v1.4.0
Long awaited TP/SL orders are here. Introducing a new set of hooks for take profit and stop loss orders. Detailed documentation here
April 21, 2024 - v1.3.2
Bug Fixes
Updates to @orderly.network/hook v1.3.2
Pricing display issue with long-tail assets and performance improvements
New Feature
New referral module @orderly.network/referral v0.1.2
New hooks:
-
useComission
-
useDaily
-
useRefereeHistory
-
useRefereeInfo
Three new referral program page components
Dashboard page:
Affiliate page:
Trader page:
April 2, 2024 - v1.2.0
Bug Fixes
Updates to @orderly.network/hook v1.2.0
The following issues are fixed:
-
Orderbook price getting stuck with drastic price changes.
-
Incorrect decimals when calling API during order placement.
-
null
error when setting limit price outside of price range when closing a position. -
Frontend validation produces inaccurate numbers when editing stop-limit orders.
-
Decimal digits for qty, price, and trigger price are incorrect in the edit order popup.
-
Incorrect decimal digits for estimated liquidation price in order entry.
-
Updates to PnL card with design enhancements.
March 19, 2024 - v1.1.9
Bug Fixes
Updates to @orderly.network/hook v1.1.9
The following issues are fixed:
-
Updated logic for pending orders.
-
Minor dependency issues.
March 20, 2024 - v1.1.8
Bug Fixes
Updates to @orderly.network/hook v1.1.7
- Minor internal issues fixed.
March 19, 2024 - v1.1.7
Bug Fixes
Updates to @orderly.network/hook v1.1.7
The following issues are fixed:
- Dependency issues at runtime.
March 19, 2024 - v1.1.6
Update
Updates to @orderly.network/hook v1.1.6
Fixes:
-
fixed wrong calculations of estLiqPrice and estLeverage.
-
Enhanced Position and Order list update frequency.
-
Minor UI issue fixes.
New:
- PnL card sharing: a PnL card can be generated based on user’s positions.
() => {
const { ref, copy, download, toDataURL, toBlob} = usePoster({
// backgroundColor: "#0b8c70",
// fontFamily: "Manrope",
backgroundImg: "/path/image.png",
color: "rgba(255, 255, 255, 0.98)",
profitColor: "rgb(0,181,159)",
lossColor: "rgb(255,103,194)",
brandColor: "rgb(0,181,159)",
data: {
message: "I am the best trader.",
domain: "broker.com",
updateTime: "2022-JAN-01 23:23",
position: {
symbol: "BTC-PERP",
currency: "USDC",
side: "LONG",
leverage: 20,
pnl: -1032.23,
ROI: -10.25,
informations: [
{ title: "Open Price", value: "59,129.12313" },
{ title: "Opened at", value: "Jan-01 23:23" },
{ title: "Mark price", value: "59,129.12313" },
{ title: "Quantity", value: "2" },
],
},
},
layout: {},
});
return <canvas ref={ref} width={550} height={300} />;
};
Either default layout can be used or one can be provided via layout
parameter. Sample code:
export const DefaultLayoutConfig: PosterLayoutConfig = {
domain: {
fontSize: 13,
// color: undefined,
position: {
left: 20,
bottom: 17,
},
},
message: {
fontSize: 20,
color: "white",
textBaseline: "top",
position: {
left: 20,
top: 16,
},
},
position: {
fontSize: 20,
color: "rgba(255,255,255,0.98)",
position: {
left: 20,
top: 70,
},
},
unrealizedPnl: {
fontSize: 36,
color: "rgba(255,255,255,0.5)",
secondaryColor: "rgba(255,255,255,0.5)",
position: {
left: 20,
top: 110,
},
},
informations: {
fontSize: 12,
color: "rgba(255, 255, 255, 0.8)",
labelColor: "rgba(255,255,255,0.36)",
position: {
left: 20,
top: 150,
},
},
updateTime: {
fontSize: 10,
color: "rgba(255,255,255,0.5)",
textAlign: "end",
position: {
right: 15,
bottom: 17,
},
},
};
March 5, 2024 - Patch Update
Update
Updates to @orderly.network/hook v1.1.4
-
removed LZ scan library, no @axios dependency required.
-
fixed token approval issues.
-
update to
useOrderbookStream
hook to addpadding
param to not return anything if the orderbook depth is not enough.
const [data] = useOrderBookStream('[symbol]', undefined, {level:10, padding:false}
//if 'padding' is true, the hook will return NaN to
//fill the data to specified level if not enough depth
- fixed WS connection issues.
February 22, 2024 - Minor Update
Update
Updates to @orderly.network/hook v1.1.3
Fixes:
- The issue of incorrect Liq. price when reading margin data, now we will pass null when it’s loading.
- The issue of Orderbook display.
- The issue of fetching incorrect symbol for mark price / symbol infos when switching symbols.
- Numerous UI issues in the desktop SDK.
Optimizations:
- Reduced the number of API calls made during open/cancel order operations to avoid triggering rate limits.
- Improved the order entry experience.
New Features:
-
Added stop order functionality in the desktop and mobile web UI.
-
Added order/position lines in the desktop web kline.
February 7, 2024 - Major Update
Update
Updates to @orderly.network/hook v1.1.2
We are excited to announce the release of version 1.1.2 of the @orderly.network/hook SDK. This update introduces significant changes and new features designed to enhance your development experience and the capabilities of your applications. Below is an overview of the key updates:
useOrderEntry
Hook Enhancements:
-
Parameter Adjustments: Now accepts an object of type
OrderEntity
with mandatory fields:order_type
,side
, andsymbol
. -
New Return Values: Includes
estLiqPrice
(Estimated Liquidation Price),estLeverage
(Leverage change post-position opening),formattedOrder
(Formatted order data), andmetaState
(Validation results and form status). -
New
submit()
Function: A parameter-free function to create orders via API, aiming to replaceonSubmit
in future releases.
useWithdraw
Hook Update:
- New
availableWithdraw
Field: Indicates the direct withdrawal amount available without needing to settle PnL, calculated based on the unsettledPnL and freeCollateral.
useDeposit
Hook Improvements:
-
New Return Fields:
depositFee
,setQuantity(quantity: number)
, andquantity
for enhanced deposit management. -
Simplified
deposit()
Function: No parameters required for operation.
Testnet Transition: Switch from Arbitrum Goerli to Arbitrum Sepolia.
Stop Limit/Stop Market Support:
-
Two new order types:
STOP_MARKET
andSTOP_LIMIT
-
Introduction of Algo orders (stop loss) with two new methods:
updateAlgoOrder(orderId: string, order: OrderEntity)
andcancelAlgoOrder(orderId: string, symbol?: string)
. -
Additional return parameters to include Algo order related properties.