Skip to content

feat: update SDK to match DLMM program v0.12.0#271

Draft
0xSoju2 wants to merge 12 commits into
MeteoraAg:mainfrom
0xSoju2:release_0.12.0
Draft

feat: update SDK to match DLMM program v0.12.0#271
0xSoju2 wants to merge 12 commits into
MeteoraAg:mainfrom
0xSoju2:release_0.12.0

Conversation

@0xSoju2

@0xSoju2 0xSoju2 commented Mar 6, 2026

Copy link
Copy Markdown

Summary

Updates the DLMM TypeScript SDK to match DLMM program v0.12.0.

Changes

IDL & Types

  • Updated idl.json and idl.ts to program v0.12.0
  • Added LimitOrder account type
  • Added collectFeeMode field
  • functionTypeconcreteFunctionType rename
  • Position V1 aliased to PositionV2

New SDK Methods

  • addLiquidityByWeight2 — v2 with Token2022 + transfer hook support, bin arrays as remaining accounts
  • placeLimitOrder — creates a limit order, deposits tokens into bins
  • cancelLimitOrder — cancels specific bins from a limit order, withdraws tokens
  • closeLimitOrderIfEmpty — closes limit order account if all bins empty, reclaims rent
  • setPermissionlessOperationBits — sets operation bits on a position
  • closeBinArray — admin-only bin array account closure

Package

  • Version bumped: 1.9.31.10.0
  • CHANGELOG updated

Testing

  • Build passes ✅
  • Devnet test (program live at same address LbVRzDTvBDEcrthxfZ4RL6yiq3uZw8bS6MwtdY6UhFQ)
  • GitHub CI

Related

Soju and others added 6 commits March 6, 2026 12:41
- Add limit order support (placeLimitOrder, cancelLimitOrder, closeLimitOrderIfEmpty)
- Add addLiquidityByWeight2 with Token2022 and transfer hook support
- Add setPermissionlessOperationBits and closeBinArray instructions
- Update IDL types to v0.12.0 (functionType -> concreteFunctionType, Bin struct changes)
- Bump package version to 1.10.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…hanges

- Rename functionType -> concreteFunctionType in initializePresetParameter calls
- Add new required collectFeeMode field to initializePresetParameter calls
- Add concreteFunctionType + collectFeeMode to initializePermissionLbPair call
- Replace removed functionBytes field with fulfilledOrderAmountX/Y in server
- Remove FunctionType import from server (no longer needed)
…ration guide

- Remove closeBinArray() — admin-only instruction, not appropriate for client SDK
- Add ts-client/MIGRATION_GUIDE.md — documents v1.9.3 → v1.10.0 breaking changes:
  functionType → concreteFunctionType rename, Position → PositionV2 alias,
  FunctionType enum values shift, new collectFeeMode field
- Add ts-client/src/test/limit_order.test.ts — integration tests for:
  placeLimitOrder, cancelLimitOrder, closeLimitOrderIfEmpty, addLiquidityByWeight2
- Update CHANGELOG.md: add Removed section, add MIGRATION_GUIDE link

build ✅
… side

Program placeLimitOrder only accepts one slice type based on isAskSide:
  - ask side → TransferHookX only
  - bid side → TransferHookY only

Passing both slices (as getPotentialToken2022IxDataAndAccounts returns)
caused InvalidRemainingAccountSlice (error 6075) on every call.

Fix: filter slices and transferHookAccounts to the relevant side only.

Verified on devnet:
  placeLimitOrder:      4uTPj1NYh2NphZ4NGbhYLcrczf28qEtD13sbW8pie8CJHSX5XNKeaypungB2kA1yd6q5iFpUdzRWLRgQ1gVSf2Tz
  cancelLimitOrder:     22VGQPe8ixFt5vfAB2rycFD67gMQz4wDFryDX8D9eY3aTfWgK8yFyy4jV7CEc5ymAsfoUjusLmrn483EsRG1uUfd
  closeLimitOrderIfEmpty: Z1f9WW12ZfiqYpxYCKygG6JeWu5Uf64T1dUsJi56BFquUhNGLz79HQJGe3xhNMf8z239NgHpPDmReoX4bdTcX25
@aleph-labs-hq

Copy link
Copy Markdown

[vulture-outreach-20260308]
Quick follow-up in case useful for release timing.

I can still deliver a compact 24h integration brief:

  1. change-impact map
  2. regression checklist
  3. go/no-go rollback gates

If useful, I can start immediately.

Soju and others added 6 commits March 12, 2026 11:54
Merges limit order support functions from PR MeteoraAg#273: isSupportLimitOrder
determines pool type, getFeeMode dispatches fee collection mode based on
CollectFeeMode enum.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…classes

Adds ILimitOrder/ILimitOrderBinData interfaces, LimitOrderV1Wrapper,
ParsedLimitOrder types, and wrapLimitOrder factory from PR MeteoraAg#273.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds LimitOrderBinData, PlaceLimitOrderParams, ParsedLimitOrderWithPubkey,
LIMIT_ORDER_MIN_SIZE/BIN_DATA_SIZE constants, BinLiquidity limit order
fields, feeOnInput to SwapQuote, PositionPermission and LimitOrderStatus
enums from PR MeteoraAg#273.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ssions

Adds export * from "./bin", includes LimitOrder in decodeAccount generic
union, and adds encodePositionPermissions helper from PR MeteoraAg#273.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…aAg#273

Constants: adds BIN_ARRAY_DEFAULT_VERSION, LIMIT_ORDER_FEE_SHARE,
ConcreteFunctionType, CollectFeeMode enums. AccountFilters: adds
limitOrderFilter, limitOrderOwnerFilter, limitOrderLbPairFilter.
Fee: adds swapExactInQuoteAtBin/swapExactOutQuoteAtBin alongside
existing fee helpers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds helpers/bin.ts with limit-order-aware swapExactInQuoteAtBin,
swapExactOutQuoteAtBin, getAmountIn/Out, and getLimitOrderLiquidity.
Adds limitOrders/index.ts with decodeLimitOrderBinData.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants