feat: update SDK to match DLMM program v0.12.0#271
Draft
0xSoju2 wants to merge 12 commits into
Draft
Conversation
- 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)
…mitOrder=2 (v0.12.0)
…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
|
[vulture-outreach-20260308] I can still deliver a compact 24h integration brief:
If useful, I can start immediately. |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the DLMM TypeScript SDK to match DLMM program v0.12.0.
Changes
IDL & Types
idl.jsonandidl.tsto program v0.12.0LimitOrderaccount typecollectFeeModefieldfunctionType→concreteFunctionTyperenamePositionV1 aliased toPositionV2New SDK Methods
addLiquidityByWeight2— v2 with Token2022 + transfer hook support, bin arrays as remaining accountsplaceLimitOrder— creates a limit order, deposits tokens into binscancelLimitOrder— cancels specific bins from a limit order, withdraws tokenscloseLimitOrderIfEmpty— closes limit order account if all bins empty, reclaims rentsetPermissionlessOperationBits— sets operation bits on a positioncloseBinArray— admin-only bin array account closurePackage
1.9.3→1.10.0Testing
LbVRzDTvBDEcrthxfZ4RL6yiq3uZw8bS6MwtdY6UhFQ)Related