npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-tk-modify-orders

v1.0.0

Published

n8n custom nodes for Bitget Exchange – Place Order, Modify Open Order, Modify Open Position (all API v2 options included)

Readme

n8n-nodes-tk-modify-orders

A custom n8n node package for the Bitget Exchange (Futures/Contracts).
Includes all parameters from the official Bitget API v2 for placing, modifying orders, and managing open positions.


Nodes Included

| Node | Operation | |---|---| | Bitget TK – Place Order | Place a new futures order (all order types, TP/SL presets, STP) | | Bitget TK – Modify Open Order | Modify pending regular orders, trigger/plan orders, or TP/SL orders | | Bitget TK – Modify Open Position | Change leverage, margin, margin mode, position mode, set TP/SL, flash close |


Installation

From npm (once published)

cd ~/.n8n/custom
npm install n8n-nodes-tk-modify-orders

Manual Installation (local development)

# 1. Clone / copy this folder to your n8n custom nodes directory
cp -r n8n-nodes-tk-modify-orders ~/.n8n/custom/

# 2. Install and build
cd ~/.n8n/custom/n8n-nodes-tk-modify-orders
npm install
npm run build

# 3. Restart n8n

Build from Source (TypeScript)

npm install
npm run build

Credentials Setup

In n8n, create a new credential of type Bitget TK API and fill in:

| Field | Description | |---|---| | API Key | Your Bitget API Key | | Secret Key | Your Bitget Secret Key | | Passphrase | The passphrase set when creating your API key |

Generate credentials at: Bitget → Settings → API Management


Node Reference

1. Bitget TK – Place Order

Endpoint: POST /api/v2/mix/order/place-order

| Parameter | Type | Required | Description | |---|---|---|---| | symbol | string | ✅ | e.g. BTCUSDT | | productType | select | ✅ | USDT-FUTURES, COIN-FUTURES, USDC-FUTURES, SUSDT-FUTURES, SCOIN-FUTURES, SUSDC-FUTURES | | marginMode | select | ✅ | isolated / crossed | | marginCoin | string | ✅ | e.g. USDT | | side | select | ✅ | buy / sell | | tradeSide | select | — | open / close (hedge mode only) | | orderType | select | ✅ | limit / market | | size | string | ✅ | Order quantity | | price | string | for limit | Limit price | | force | select | — | gtc / ioc / fok / post_only | | clientOid | string | — | Custom order ID (recommended) | | reduceOnly | select | — | NO / YES | | presetStopSurplusPrice | string | — | Preset TP trigger price | | presetStopSurplusExecutePrice | string | — | Preset TP execute price | | presetStopSurplusTriggerType | select | — | fill_price / mark_price / index_price | | presetStopLossPrice | string | — | Preset SL trigger price | | presetStopLossExecutePrice | string | — | Preset SL execute price | | presetStopLossTriggerType | select | — | fill_price / mark_price / index_price | | stpMode | select | — | Self-trade prevention: cancel_maker / cancel_taker / cancel_both |


2. Bitget TK – Modify Open Order

Choose the Order Operation:

A) Modify Regular Order

Endpoint: POST /api/v2/mix/order/modify-order

| Parameter | Description | |---|---| | symbol, productType, marginCoin | Identify the market | | orderId / clientOid | Identify the order (at least one required) | | newClientOid | Reassign a new client ID | | newPrice | New limit price | | newSize | New quantity | | newPresetStopSurplusPrice | Update attached TP price | | newPresetStopLossPrice | Update attached SL price |

B) Modify Trigger / Plan Order

Endpoint: POST /api/v2/mix/order/modify-plan-order

| Parameter | Description | |---|---| | planType | normal_plan (trigger) / track_plan (trailing stop) | | orderId / clientOid | Identify the order | | newSize | New quantity | | newPrice | New execution price | | newTriggerPrice | New trigger price | | newTriggerType | fill_price / mark_price / index_price | | newCallbackRatio | Trailing ratio (%) for track_plan | | newStopSurplusTriggerPrice / Type / ExecutePrice | Attached TP modification | | newStopLossTriggerPrice / Type / ExecutePrice | Attached SL modification |

C) Modify TP/SL Order

Endpoint: POST /api/v2/mix/order/modify-tpsl-order

| Parameter | Description | |---|---| | orderId / clientOid | Identify the order | | triggerPrice | New trigger price | | triggerType | fill_price / mark_price / index_price | | executePrice | New execution price (0 = market) | | size | New quantity | | rangeRate | Trailing % for trailing TP/SL |


3. Bitget TK – Modify Open Position

Choose the Position Operation:

| Operation | Endpoint | Key Parameters | |---|---|---| | Change Leverage | POST /api/v2/mix/account/set-leverage | symbol, productType, marginCoin, leverage, holdSide (long/short for hedge) | | Adjust Position Margin | POST /api/v2/mix/account/set-margin | symbol, productType, marginCoin, amount (+/-), holdSide | | Change Margin Mode | POST /api/v2/mix/account/set-margin-mode | symbol, productType, marginCoin, marginMode (isolated/crossed) | | Change Position Mode | POST /api/v2/mix/account/set-position-mode | productType, posMode (one_way_mode/hedge_mode) | | Set Position TP/SL | POST /api/v2/mix/order/place-pos-tpsl | symbol, holdSide, stopSurplus + stopLoss trigger/execute/type prices, custom clientOids | | Place Single TP/SL | POST /api/v2/mix/order/place-tpsl-order | planType, symbol, holdSide, triggerPrice, triggerType, executePrice, size, rangeRate | | Flash Close Position | POST /api/v2/mix/order/close-positions | symbol, productType, holdSide (or both), clientOid |


Position Mode Guide

One-Way Mode:

  • side=buy → Opens long OR closes short
  • side=sell → Opens short OR closes long
  • Use reduceOnly=YES to force close-only

Hedge Mode:

  • side=buy + tradeSide=open → Open long
  • side=buy + tradeSide=close → Close long
  • side=sell + tradeSide=open → Open short
  • side=sell + tradeSide=close → Close short

Rate Limits

All endpoints: 10 requests/second per UID


API Reference


License

MIT