@picon-finance/dlmm-sdk 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/entities/bin_array.d.ts.map +1 -1
  2. package/dist/entities/dlmm_program.d.ts.map +1 -1
  3. package/dist/entities/pool.d.ts.map +1 -1
  4. package/dist/entities/position.d.ts.map +1 -1
  5. package/dist/generated/accounts/adminConfig.d.ts +8 -8
  6. package/dist/generated/accounts/adminConfig.d.ts.map +1 -1
  7. package/dist/generated/accounts/adminConfig.js +2 -2
  8. package/dist/generated/accounts/binArray.d.ts +7 -7
  9. package/dist/generated/accounts/binArray.d.ts.map +1 -1
  10. package/dist/generated/accounts/binArray.js +2 -2
  11. package/dist/generated/accounts/pool.d.ts +9 -9
  12. package/dist/generated/accounts/pool.d.ts.map +1 -1
  13. package/dist/generated/accounts/pool.js +2 -2
  14. package/dist/generated/accounts/position.d.ts +7 -7
  15. package/dist/generated/accounts/position.d.ts.map +1 -1
  16. package/dist/generated/accounts/position.js +2 -2
  17. package/dist/generated/errors/piconDlmm.d.ts +4 -2
  18. package/dist/generated/errors/piconDlmm.d.ts.map +1 -1
  19. package/dist/generated/errors/piconDlmm.js +6 -2
  20. package/dist/generated/events/claimFeeEvent.d.ts +4 -4
  21. package/dist/generated/events/claimFeeEvent.d.ts.map +1 -1
  22. package/dist/generated/events/closePositionEvent.d.ts +8 -2
  23. package/dist/generated/events/closePositionEvent.d.ts.map +1 -1
  24. package/dist/generated/events/createPoolEvent.d.ts +8 -2
  25. package/dist/generated/events/createPoolEvent.d.ts.map +1 -1
  26. package/dist/generated/events/depositEvent.d.ts +4 -4
  27. package/dist/generated/events/depositEvent.d.ts.map +1 -1
  28. package/dist/generated/events/openPositionEvent.d.ts +8 -2
  29. package/dist/generated/events/openPositionEvent.d.ts.map +1 -1
  30. package/dist/generated/events/swapEvent.d.ts +2 -2
  31. package/dist/generated/events/swapEvent.d.ts.map +1 -1
  32. package/dist/generated/events/withdrawEvent.d.ts +4 -4
  33. package/dist/generated/events/withdrawEvent.d.ts.map +1 -1
  34. package/dist/generated/instructions/acceptAdminAuthority.d.ts +6 -2
  35. package/dist/generated/instructions/acceptAdminAuthority.d.ts.map +1 -1
  36. package/dist/generated/instructions/acceptAdminAuthority.js +8 -2
  37. package/dist/generated/instructions/claimFee.d.ts +3 -1
  38. package/dist/generated/instructions/claimFee.d.ts.map +1 -1
  39. package/dist/generated/instructions/claimFee.js +4 -1
  40. package/dist/generated/instructions/claimProtocolFee.d.ts +6 -2
  41. package/dist/generated/instructions/claimProtocolFee.d.ts.map +1 -1
  42. package/dist/generated/instructions/claimProtocolFee.js +8 -2
  43. package/dist/generated/instructions/closePosition.d.ts +6 -2
  44. package/dist/generated/instructions/closePosition.d.ts.map +1 -1
  45. package/dist/generated/instructions/closePosition.js +8 -2
  46. package/dist/generated/instructions/createAdminConfig.d.ts +6 -2
  47. package/dist/generated/instructions/createAdminConfig.d.ts.map +1 -1
  48. package/dist/generated/instructions/createAdminConfig.js +8 -2
  49. package/dist/generated/instructions/createBinArray.d.ts +6 -2
  50. package/dist/generated/instructions/createBinArray.d.ts.map +1 -1
  51. package/dist/generated/instructions/createBinArray.js +8 -2
  52. package/dist/generated/instructions/createPool.d.ts +6 -2
  53. package/dist/generated/instructions/createPool.d.ts.map +1 -1
  54. package/dist/generated/instructions/createPool.js +8 -2
  55. package/dist/generated/instructions/deleteBinArray.d.ts +8 -4
  56. package/dist/generated/instructions/deleteBinArray.d.ts.map +1 -1
  57. package/dist/generated/instructions/deleteBinArray.js +8 -2
  58. package/dist/generated/instructions/depositByWeight.d.ts +3 -1
  59. package/dist/generated/instructions/depositByWeight.d.ts.map +1 -1
  60. package/dist/generated/instructions/depositByWeight.js +4 -1
  61. package/dist/generated/instructions/openPosition.d.ts +6 -2
  62. package/dist/generated/instructions/openPosition.d.ts.map +1 -1
  63. package/dist/generated/instructions/openPosition.js +8 -2
  64. package/dist/generated/instructions/resetAdminAuthority.d.ts +6 -2
  65. package/dist/generated/instructions/resetAdminAuthority.d.ts.map +1 -1
  66. package/dist/generated/instructions/resetAdminAuthority.js +8 -2
  67. package/dist/generated/instructions/setMetadataUpdateAuthority.d.ts +8 -4
  68. package/dist/generated/instructions/setMetadataUpdateAuthority.d.ts.map +1 -1
  69. package/dist/generated/instructions/setMetadataUpdateAuthority.js +8 -2
  70. package/dist/generated/instructions/setPoolDynamicFeeConfig.d.ts +6 -2
  71. package/dist/generated/instructions/setPoolDynamicFeeConfig.d.ts.map +1 -1
  72. package/dist/generated/instructions/setPoolDynamicFeeConfig.js +8 -2
  73. package/dist/generated/instructions/setPoolProtocolShare.d.ts +6 -2
  74. package/dist/generated/instructions/setPoolProtocolShare.d.ts.map +1 -1
  75. package/dist/generated/instructions/setPoolProtocolShare.js +8 -2
  76. package/dist/generated/instructions/swapExactIn.d.ts +3 -1
  77. package/dist/generated/instructions/swapExactIn.d.ts.map +1 -1
  78. package/dist/generated/instructions/swapExactIn.js +4 -1
  79. package/dist/generated/instructions/swapExactOut.d.ts +3 -1
  80. package/dist/generated/instructions/swapExactOut.d.ts.map +1 -1
  81. package/dist/generated/instructions/swapExactOut.js +4 -1
  82. package/dist/generated/instructions/syncPool.d.ts +3 -1
  83. package/dist/generated/instructions/syncPool.d.ts.map +1 -1
  84. package/dist/generated/instructions/syncPool.js +4 -1
  85. package/dist/generated/instructions/transferAdminAuthority.d.ts +8 -4
  86. package/dist/generated/instructions/transferAdminAuthority.d.ts.map +1 -1
  87. package/dist/generated/instructions/transferAdminAuthority.js +8 -2
  88. package/dist/generated/instructions/withdraw.d.ts +3 -1
  89. package/dist/generated/instructions/withdraw.d.ts.map +1 -1
  90. package/dist/generated/instructions/withdraw.js +4 -1
  91. package/dist/generated/pdas/adminConfig.d.ts +2 -2
  92. package/dist/generated/pdas/adminConfig.d.ts.map +1 -1
  93. package/dist/generated/pdas/adminConfig.js +4 -1
  94. package/dist/generated/pdas/binArray.d.ts +3 -3
  95. package/dist/generated/pdas/binArray.d.ts.map +1 -1
  96. package/dist/generated/pdas/binArray.js +4 -1
  97. package/dist/generated/pdas/pool.d.ts +4 -4
  98. package/dist/generated/pdas/pool.d.ts.map +1 -1
  99. package/dist/generated/pdas/pool.js +4 -1
  100. package/dist/generated/pdas/position.d.ts +3 -3
  101. package/dist/generated/pdas/position.d.ts.map +1 -1
  102. package/dist/generated/pdas/position.js +4 -1
  103. package/dist/generated/programs/piconDlmm.d.ts +61 -21
  104. package/dist/generated/programs/piconDlmm.d.ts.map +1 -1
  105. package/dist/generated/programs/piconDlmm.js +69 -26
  106. package/package.json +11 -10
  107. package/src/generated/accounts/adminConfig.ts +18 -9
  108. package/src/generated/accounts/binArray.ts +17 -8
  109. package/src/generated/accounts/pool.ts +19 -10
  110. package/src/generated/accounts/position.ts +17 -8
  111. package/src/generated/errors/piconDlmm.ts +9 -1
  112. package/src/generated/events/claimFeeEvent.ts +4 -3
  113. package/src/generated/events/closePositionEvent.ts +8 -1
  114. package/src/generated/events/createPoolEvent.ts +8 -1
  115. package/src/generated/events/depositEvent.ts +4 -3
  116. package/src/generated/events/openPositionEvent.ts +8 -1
  117. package/src/generated/events/swapEvent.ts +2 -1
  118. package/src/generated/events/withdrawEvent.ts +4 -3
  119. package/src/generated/instructions/acceptAdminAuthority.ts +18 -4
  120. package/src/generated/instructions/claimFee.ts +9 -2
  121. package/src/generated/instructions/claimProtocolFee.ts +18 -4
  122. package/src/generated/instructions/closePosition.ts +18 -4
  123. package/src/generated/instructions/createAdminConfig.ts +18 -4
  124. package/src/generated/instructions/createBinArray.ts +18 -4
  125. package/src/generated/instructions/createPool.ts +18 -4
  126. package/src/generated/instructions/deleteBinArray.ts +20 -5
  127. package/src/generated/instructions/depositByWeight.ts +9 -2
  128. package/src/generated/instructions/openPosition.ts +18 -4
  129. package/src/generated/instructions/resetAdminAuthority.ts +18 -4
  130. package/src/generated/instructions/setMetadataUpdateAuthority.ts +20 -5
  131. package/src/generated/instructions/setPoolDynamicFeeConfig.ts +18 -4
  132. package/src/generated/instructions/setPoolProtocolShare.ts +18 -4
  133. package/src/generated/instructions/swapExactIn.ts +9 -2
  134. package/src/generated/instructions/swapExactOut.ts +9 -2
  135. package/src/generated/instructions/syncPool.ts +9 -2
  136. package/src/generated/instructions/transferAdminAuthority.ts +20 -5
  137. package/src/generated/instructions/withdraw.ts +9 -2
  138. package/src/generated/pdas/adminConfig.ts +8 -2
  139. package/src/generated/pdas/binArray.ts +9 -3
  140. package/src/generated/pdas/pool.ts +10 -4
  141. package/src/generated/pdas/position.ts +9 -3
  142. package/src/generated/programs/piconDlmm.ts +149 -45
@@ -131,7 +131,9 @@ export function getSyncPoolInstruction<
131
131
  TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
132
132
  >(
133
133
  input: SyncPoolInput<TAccountUser, TAccountPool>,
134
- config?: { programAddress?: TProgramAddress },
134
+ config?: {
135
+ programAddress?: TProgramAddress | { readonly address: TProgramAddress };
136
+ },
135
137
  ): SyncPoolInstruction<
136
138
  TProgramAddress,
137
139
  ResolvedInstructionAccountMeta<
@@ -144,7 +146,12 @@ export function getSyncPoolInstruction<
144
146
  >
145
147
  > {
146
148
  // Program address.
147
- const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
149
+ const programAddressInput =
150
+ config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
151
+ const programAddress =
152
+ typeof programAddressInput === "string"
153
+ ? programAddressInput
154
+ : programAddressInput.address;
148
155
 
149
156
  // Account meta helper.
150
157
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
@@ -25,6 +25,7 @@ import {
25
25
  type FixedSizeCodec,
26
26
  type FixedSizeDecoder,
27
27
  type FixedSizeEncoder,
28
+ type HasAddress,
28
29
  type Instruction,
29
30
  type InstructionWithAccounts,
30
31
  type InstructionWithData,
@@ -78,7 +79,7 @@ export type TransferAdminAuthorityInstructionData = {
78
79
  };
79
80
 
80
81
  export type TransferAdminAuthorityInstructionDataArgs = {
81
- newAuthority: Address;
82
+ newAuthority: Address | HasAddress;
82
83
  };
83
84
 
84
85
  export function getTransferAdminAuthorityInstructionDataEncoder(): FixedSizeEncoder<TransferAdminAuthorityInstructionDataArgs> {
@@ -129,7 +130,9 @@ export async function getTransferAdminAuthorityInstructionAsync<
129
130
  TAccountAuthority,
130
131
  TAccountAdminConfig
131
132
  >,
132
- config?: { programAddress?: TProgramAddress },
133
+ config?: {
134
+ programAddress?: TProgramAddress | { readonly address: TProgramAddress };
135
+ },
133
136
  ): Promise<
134
137
  TransferAdminAuthorityInstruction<
135
138
  TProgramAddress,
@@ -144,7 +147,12 @@ export async function getTransferAdminAuthorityInstructionAsync<
144
147
  >
145
148
  > {
146
149
  // Program address.
147
- const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
150
+ const programAddressInput =
151
+ config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
152
+ const programAddress =
153
+ typeof programAddressInput === "string"
154
+ ? programAddressInput
155
+ : programAddressInput.address;
148
156
 
149
157
  // Account meta helper.
150
158
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
@@ -212,7 +220,9 @@ export function getTransferAdminAuthorityInstruction<
212
220
  TProgramAddress extends Address = typeof PICON_DLMM_PROGRAM_ADDRESS,
213
221
  >(
214
222
  input: TransferAdminAuthorityInput<TAccountAuthority, TAccountAdminConfig>,
215
- config?: { programAddress?: TProgramAddress },
223
+ config?: {
224
+ programAddress?: TProgramAddress | { readonly address: TProgramAddress };
225
+ },
216
226
  ): TransferAdminAuthorityInstruction<
217
227
  TProgramAddress,
218
228
  ResolvedInstructionAccountMeta<
@@ -225,7 +235,12 @@ export function getTransferAdminAuthorityInstruction<
225
235
  >
226
236
  > {
227
237
  // Program address.
228
- const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
238
+ const programAddressInput =
239
+ config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
240
+ const programAddress =
241
+ typeof programAddressInput === "string"
242
+ ? programAddressInput
243
+ : programAddressInput.address;
229
244
 
230
245
  // Account meta helper.
231
246
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
@@ -261,7 +261,9 @@ export function getWithdrawInstruction<
261
261
  TAccountLowerBinArray,
262
262
  TAccountUpperBinArray
263
263
  >,
264
- config?: { programAddress?: TProgramAddress },
264
+ config?: {
265
+ programAddress?: TProgramAddress | { readonly address: TProgramAddress };
266
+ },
265
267
  ): WithdrawInstruction<
266
268
  TProgramAddress,
267
269
  ResolvedInstructionAccountMeta<
@@ -322,7 +324,12 @@ export function getWithdrawInstruction<
322
324
  >
323
325
  > {
324
326
  // Program address.
325
- const programAddress = config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
327
+ const programAddressInput =
328
+ config?.programAddress ?? PICON_DLMM_PROGRAM_ADDRESS;
329
+ const programAddress =
330
+ typeof programAddressInput === "string"
331
+ ? programAddressInput
332
+ : programAddressInput.address;
326
333
 
327
334
  // Account meta helper.
328
335
  const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
@@ -10,15 +10,21 @@ import {
10
10
  getBytesEncoder,
11
11
  getProgramDerivedAddress,
12
12
  type Address,
13
+ type HasAddress,
13
14
  type ProgramDerivedAddress,
14
15
  } from "@solana/kit";
15
16
 
16
17
  export async function findAdminConfigPda(
17
- config: { programAddress?: Address | undefined } = {},
18
+ config: { programAddress?: Address | HasAddress | undefined } = {},
18
19
  ): Promise<ProgramDerivedAddress> {
19
20
  const {
20
- programAddress = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC" as Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">,
21
+ programAddress:
22
+ programAddressInput = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC" as Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">,
21
23
  } = config;
24
+ const programAddress =
25
+ typeof programAddressInput === "string"
26
+ ? programAddressInput
27
+ : programAddressInput.address;
22
28
  return await getProgramDerivedAddress({
23
29
  programAddress,
24
30
  seeds: [
@@ -12,21 +12,27 @@ import {
12
12
  getI32Encoder,
13
13
  getProgramDerivedAddress,
14
14
  type Address,
15
+ type HasAddress,
15
16
  type ProgramDerivedAddress,
16
17
  } from "@solana/kit";
17
18
 
18
19
  export type BinArraySeeds = {
19
- pool: Address;
20
+ pool: Address | HasAddress;
20
21
  index: number;
21
22
  };
22
23
 
23
24
  export async function findBinArrayPda(
24
25
  seeds: BinArraySeeds,
25
- config: { programAddress?: Address | undefined } = {},
26
+ config: { programAddress?: Address | HasAddress | undefined } = {},
26
27
  ): Promise<ProgramDerivedAddress> {
27
28
  const {
28
- programAddress = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC" as Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">,
29
+ programAddress:
30
+ programAddressInput = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC" as Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">,
29
31
  } = config;
32
+ const programAddress =
33
+ typeof programAddressInput === "string"
34
+ ? programAddressInput
35
+ : programAddressInput.address;
30
36
  return await getProgramDerivedAddress({
31
37
  programAddress,
32
38
  seeds: [
@@ -13,23 +13,29 @@ import {
13
13
  getU16Encoder,
14
14
  getU32Encoder,
15
15
  type Address,
16
+ type HasAddress,
16
17
  type ProgramDerivedAddress,
17
18
  } from "@solana/kit";
18
19
 
19
20
  export type PoolSeeds = {
20
- tokenMintX: Address;
21
- tokenMintY: Address;
21
+ tokenMintX: Address | HasAddress;
22
+ tokenMintY: Address | HasAddress;
22
23
  binStep: number;
23
24
  feeRate: number;
24
25
  };
25
26
 
26
27
  export async function findPoolPda(
27
28
  seeds: PoolSeeds,
28
- config: { programAddress?: Address | undefined } = {},
29
+ config: { programAddress?: Address | HasAddress | undefined } = {},
29
30
  ): Promise<ProgramDerivedAddress> {
30
31
  const {
31
- programAddress = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC" as Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">,
32
+ programAddress:
33
+ programAddressInput = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC" as Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">,
32
34
  } = config;
35
+ const programAddress =
36
+ typeof programAddressInput === "string"
37
+ ? programAddressInput
38
+ : programAddressInput.address;
33
39
  return await getProgramDerivedAddress({
34
40
  programAddress,
35
41
  seeds: [
@@ -11,20 +11,26 @@ import {
11
11
  getBytesEncoder,
12
12
  getProgramDerivedAddress,
13
13
  type Address,
14
+ type HasAddress,
14
15
  type ProgramDerivedAddress,
15
16
  } from "@solana/kit";
16
17
 
17
18
  export type PositionSeeds = {
18
- positionMint: Address;
19
+ positionMint: Address | HasAddress;
19
20
  };
20
21
 
21
22
  export async function findPositionPda(
22
23
  seeds: PositionSeeds,
23
- config: { programAddress?: Address | undefined } = {},
24
+ config: { programAddress?: Address | HasAddress | undefined } = {},
24
25
  ): Promise<ProgramDerivedAddress> {
25
26
  const {
26
- programAddress = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC" as Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">,
27
+ programAddress:
28
+ programAddressInput = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC" as Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">,
27
29
  } = config;
30
+ const programAddress =
31
+ typeof programAddressInput === "string"
32
+ ? programAddressInput
33
+ : programAddressInput.address;
28
34
  return await getProgramDerivedAddress({
29
35
  programAddress,
30
36
  seeds: [
@@ -24,6 +24,7 @@ import {
24
24
  type ExtendedClient,
25
25
  type GetAccountInfoApi,
26
26
  type GetMultipleAccountsApi,
27
+ type HasAddress,
27
28
  type Instruction,
28
29
  type InstructionWithData,
29
30
  type ReadonlyUint8Array,
@@ -766,74 +767,93 @@ export type PiconDlmmPluginAccounts = {
766
767
  export type PiconDlmmPluginInstructions = {
767
768
  acceptAdminAuthority: (
768
769
  input: AcceptAdminAuthorityAsyncInput,
770
+ config?: { programAddress?: Address | HasAddress },
769
771
  ) => ReturnType<typeof getAcceptAdminAuthorityInstructionAsync> &
770
772
  SelfPlanAndSendFunctions;
771
773
  claimFee: (
772
774
  input: ClaimFeeInput,
775
+ config?: { programAddress?: Address | HasAddress },
773
776
  ) => ReturnType<typeof getClaimFeeInstruction> & SelfPlanAndSendFunctions;
774
777
  claimProtocolFee: (
775
778
  input: ClaimProtocolFeeAsyncInput,
779
+ config?: { programAddress?: Address | HasAddress },
776
780
  ) => ReturnType<typeof getClaimProtocolFeeInstructionAsync> &
777
781
  SelfPlanAndSendFunctions;
778
782
  closePosition: (
779
783
  input: ClosePositionAsyncInput,
784
+ config?: { programAddress?: Address | HasAddress },
780
785
  ) => ReturnType<typeof getClosePositionInstructionAsync> &
781
786
  SelfPlanAndSendFunctions;
782
787
  createAdminConfig: (
783
788
  input: CreateAdminConfigAsyncInput,
789
+ config?: { programAddress?: Address | HasAddress },
784
790
  ) => ReturnType<typeof getCreateAdminConfigInstructionAsync> &
785
791
  SelfPlanAndSendFunctions;
786
792
  createBinArray: (
787
793
  input: MakeOptional<CreateBinArrayAsyncInput, "payer">,
794
+ config?: { programAddress?: Address | HasAddress },
788
795
  ) => ReturnType<typeof getCreateBinArrayInstructionAsync> &
789
796
  SelfPlanAndSendFunctions;
790
797
  createPool: (
791
798
  input: CreatePoolAsyncInput,
799
+ config?: { programAddress?: Address | HasAddress },
792
800
  ) => ReturnType<typeof getCreatePoolInstructionAsync> &
793
801
  SelfPlanAndSendFunctions;
794
802
  deleteBinArray: (
795
803
  input: DeleteBinArrayAsyncInput,
804
+ config?: { programAddress?: Address | HasAddress },
796
805
  ) => ReturnType<typeof getDeleteBinArrayInstructionAsync> &
797
806
  SelfPlanAndSendFunctions;
798
807
  depositByWeight: (
799
808
  input: DepositByWeightInput,
809
+ config?: { programAddress?: Address | HasAddress },
800
810
  ) => ReturnType<typeof getDepositByWeightInstruction> &
801
811
  SelfPlanAndSendFunctions;
802
812
  openPosition: (
803
813
  input: OpenPositionAsyncInput,
814
+ config?: { programAddress?: Address | HasAddress },
804
815
  ) => ReturnType<typeof getOpenPositionInstructionAsync> &
805
816
  SelfPlanAndSendFunctions;
806
817
  resetAdminAuthority: (
807
818
  input: ResetAdminAuthorityAsyncInput,
819
+ config?: { programAddress?: Address | HasAddress },
808
820
  ) => ReturnType<typeof getResetAdminAuthorityInstructionAsync> &
809
821
  SelfPlanAndSendFunctions;
810
822
  setMetadataUpdateAuthority: (
811
823
  input: SetMetadataUpdateAuthorityAsyncInput,
824
+ config?: { programAddress?: Address | HasAddress },
812
825
  ) => ReturnType<typeof getSetMetadataUpdateAuthorityInstructionAsync> &
813
826
  SelfPlanAndSendFunctions;
814
827
  setPoolDynamicFeeConfig: (
815
828
  input: SetPoolDynamicFeeConfigAsyncInput,
829
+ config?: { programAddress?: Address | HasAddress },
816
830
  ) => ReturnType<typeof getSetPoolDynamicFeeConfigInstructionAsync> &
817
831
  SelfPlanAndSendFunctions;
818
832
  setPoolProtocolShare: (
819
833
  input: SetPoolProtocolShareAsyncInput,
834
+ config?: { programAddress?: Address | HasAddress },
820
835
  ) => ReturnType<typeof getSetPoolProtocolShareInstructionAsync> &
821
836
  SelfPlanAndSendFunctions;
822
837
  swapExactIn: (
823
838
  input: SwapExactInInput,
839
+ config?: { programAddress?: Address | HasAddress },
824
840
  ) => ReturnType<typeof getSwapExactInInstruction> & SelfPlanAndSendFunctions;
825
841
  swapExactOut: (
826
842
  input: SwapExactOutInput,
843
+ config?: { programAddress?: Address | HasAddress },
827
844
  ) => ReturnType<typeof getSwapExactOutInstruction> & SelfPlanAndSendFunctions;
828
845
  syncPool: (
829
846
  input: SyncPoolInput,
847
+ config?: { programAddress?: Address | HasAddress },
830
848
  ) => ReturnType<typeof getSyncPoolInstruction> & SelfPlanAndSendFunctions;
831
849
  transferAdminAuthority: (
832
850
  input: TransferAdminAuthorityAsyncInput,
851
+ config?: { programAddress?: Address | HasAddress },
833
852
  ) => ReturnType<typeof getTransferAdminAuthorityInstructionAsync> &
834
853
  SelfPlanAndSendFunctions;
835
854
  withdraw: (
836
855
  input: WithdrawInput,
856
+ config?: { programAddress?: Address | HasAddress },
837
857
  ) => ReturnType<typeof getWithdrawInstruction> & SelfPlanAndSendFunctions;
838
858
  };
839
859
 
@@ -851,7 +871,9 @@ export type PiconDlmmPluginRequirements = ClientWithRpc<
851
871
  ClientWithTransactionPlanning &
852
872
  ClientWithTransactionSending;
853
873
 
854
- export function piconDlmmProgram() {
874
+ export function piconDlmmProgram(
875
+ config: { programAddress?: Address | HasAddress } = {},
876
+ ) {
855
877
  return <T extends PiconDlmmPluginRequirements>(
856
878
  client: T,
857
879
  ): ExtendedClient<T, { piconDlmm: PiconDlmmPlugin }> => {
@@ -864,101 +886,183 @@ export function piconDlmmProgram() {
864
886
  position: addSelfFetchFunctions(client, getPositionCodec()),
865
887
  },
866
888
  instructions: {
867
- acceptAdminAuthority: (input) =>
889
+ acceptAdminAuthority: (input, instructionConfig) =>
868
890
  addSelfPlanAndSendFunctions(
869
891
  client,
870
- getAcceptAdminAuthorityInstructionAsync(input),
892
+ getAcceptAdminAuthorityInstructionAsync(input, {
893
+ programAddress:
894
+ instructionConfig?.programAddress ?? config.programAddress,
895
+ }),
896
+ ),
897
+ claimFee: (input, instructionConfig) =>
898
+ addSelfPlanAndSendFunctions(
899
+ client,
900
+ getClaimFeeInstruction(input, {
901
+ programAddress:
902
+ instructionConfig?.programAddress ?? config.programAddress,
903
+ }),
904
+ ),
905
+ claimProtocolFee: (input, instructionConfig) =>
906
+ addSelfPlanAndSendFunctions(
907
+ client,
908
+ getClaimProtocolFeeInstructionAsync(input, {
909
+ programAddress:
910
+ instructionConfig?.programAddress ?? config.programAddress,
911
+ }),
912
+ ),
913
+ closePosition: (input, instructionConfig) =>
914
+ addSelfPlanAndSendFunctions(
915
+ client,
916
+ getClosePositionInstructionAsync(input, {
917
+ programAddress:
918
+ instructionConfig?.programAddress ?? config.programAddress,
919
+ }),
871
920
  ),
872
- claimFee: (input) =>
873
- addSelfPlanAndSendFunctions(client, getClaimFeeInstruction(input)),
874
- claimProtocolFee: (input) =>
921
+ createAdminConfig: (input, instructionConfig) =>
875
922
  addSelfPlanAndSendFunctions(
876
923
  client,
877
- getClaimProtocolFeeInstructionAsync(input),
924
+ getCreateAdminConfigInstructionAsync(input, {
925
+ programAddress:
926
+ instructionConfig?.programAddress ?? config.programAddress,
927
+ }),
878
928
  ),
879
- closePosition: (input) =>
929
+ createBinArray: (input, instructionConfig) =>
880
930
  addSelfPlanAndSendFunctions(
881
931
  client,
882
- getClosePositionInstructionAsync(input),
932
+ getCreateBinArrayInstructionAsync(
933
+ { ...input, payer: input.payer ?? client.payer },
934
+ {
935
+ programAddress:
936
+ instructionConfig?.programAddress ?? config.programAddress,
937
+ },
938
+ ),
883
939
  ),
884
- createAdminConfig: (input) =>
940
+ createPool: (input, instructionConfig) =>
885
941
  addSelfPlanAndSendFunctions(
886
942
  client,
887
- getCreateAdminConfigInstructionAsync(input),
943
+ getCreatePoolInstructionAsync(input, {
944
+ programAddress:
945
+ instructionConfig?.programAddress ?? config.programAddress,
946
+ }),
888
947
  ),
889
- createBinArray: (input) =>
948
+ deleteBinArray: (input, instructionConfig) =>
890
949
  addSelfPlanAndSendFunctions(
891
950
  client,
892
- getCreateBinArrayInstructionAsync({
893
- ...input,
894
- payer: input.payer ?? client.payer,
951
+ getDeleteBinArrayInstructionAsync(input, {
952
+ programAddress:
953
+ instructionConfig?.programAddress ?? config.programAddress,
895
954
  }),
896
955
  ),
897
- createPool: (input) =>
956
+ depositByWeight: (input, instructionConfig) =>
898
957
  addSelfPlanAndSendFunctions(
899
958
  client,
900
- getCreatePoolInstructionAsync(input),
959
+ getDepositByWeightInstruction(input, {
960
+ programAddress:
961
+ instructionConfig?.programAddress ?? config.programAddress,
962
+ }),
901
963
  ),
902
- deleteBinArray: (input) =>
964
+ openPosition: (input, instructionConfig) =>
903
965
  addSelfPlanAndSendFunctions(
904
966
  client,
905
- getDeleteBinArrayInstructionAsync(input),
967
+ getOpenPositionInstructionAsync(input, {
968
+ programAddress:
969
+ instructionConfig?.programAddress ?? config.programAddress,
970
+ }),
906
971
  ),
907
- depositByWeight: (input) =>
972
+ resetAdminAuthority: (input, instructionConfig) =>
908
973
  addSelfPlanAndSendFunctions(
909
974
  client,
910
- getDepositByWeightInstruction(input),
975
+ getResetAdminAuthorityInstructionAsync(input, {
976
+ programAddress:
977
+ instructionConfig?.programAddress ?? config.programAddress,
978
+ }),
911
979
  ),
912
- openPosition: (input) =>
980
+ setMetadataUpdateAuthority: (input, instructionConfig) =>
913
981
  addSelfPlanAndSendFunctions(
914
982
  client,
915
- getOpenPositionInstructionAsync(input),
983
+ getSetMetadataUpdateAuthorityInstructionAsync(input, {
984
+ programAddress:
985
+ instructionConfig?.programAddress ?? config.programAddress,
986
+ }),
916
987
  ),
917
- resetAdminAuthority: (input) =>
988
+ setPoolDynamicFeeConfig: (input, instructionConfig) =>
918
989
  addSelfPlanAndSendFunctions(
919
990
  client,
920
- getResetAdminAuthorityInstructionAsync(input),
991
+ getSetPoolDynamicFeeConfigInstructionAsync(input, {
992
+ programAddress:
993
+ instructionConfig?.programAddress ?? config.programAddress,
994
+ }),
921
995
  ),
922
- setMetadataUpdateAuthority: (input) =>
996
+ setPoolProtocolShare: (input, instructionConfig) =>
923
997
  addSelfPlanAndSendFunctions(
924
998
  client,
925
- getSetMetadataUpdateAuthorityInstructionAsync(input),
999
+ getSetPoolProtocolShareInstructionAsync(input, {
1000
+ programAddress:
1001
+ instructionConfig?.programAddress ?? config.programAddress,
1002
+ }),
926
1003
  ),
927
- setPoolDynamicFeeConfig: (input) =>
1004
+ swapExactIn: (input, instructionConfig) =>
928
1005
  addSelfPlanAndSendFunctions(
929
1006
  client,
930
- getSetPoolDynamicFeeConfigInstructionAsync(input),
1007
+ getSwapExactInInstruction(input, {
1008
+ programAddress:
1009
+ instructionConfig?.programAddress ?? config.programAddress,
1010
+ }),
931
1011
  ),
932
- setPoolProtocolShare: (input) =>
1012
+ swapExactOut: (input, instructionConfig) =>
933
1013
  addSelfPlanAndSendFunctions(
934
1014
  client,
935
- getSetPoolProtocolShareInstructionAsync(input),
1015
+ getSwapExactOutInstruction(input, {
1016
+ programAddress:
1017
+ instructionConfig?.programAddress ?? config.programAddress,
1018
+ }),
936
1019
  ),
937
- swapExactIn: (input) =>
1020
+ syncPool: (input, instructionConfig) =>
938
1021
  addSelfPlanAndSendFunctions(
939
1022
  client,
940
- getSwapExactInInstruction(input),
1023
+ getSyncPoolInstruction(input, {
1024
+ programAddress:
1025
+ instructionConfig?.programAddress ?? config.programAddress,
1026
+ }),
941
1027
  ),
942
- swapExactOut: (input) =>
1028
+ transferAdminAuthority: (input, instructionConfig) =>
943
1029
  addSelfPlanAndSendFunctions(
944
1030
  client,
945
- getSwapExactOutInstruction(input),
1031
+ getTransferAdminAuthorityInstructionAsync(input, {
1032
+ programAddress:
1033
+ instructionConfig?.programAddress ?? config.programAddress,
1034
+ }),
946
1035
  ),
947
- syncPool: (input) =>
948
- addSelfPlanAndSendFunctions(client, getSyncPoolInstruction(input)),
949
- transferAdminAuthority: (input) =>
1036
+ withdraw: (input, instructionConfig) =>
950
1037
  addSelfPlanAndSendFunctions(
951
1038
  client,
952
- getTransferAdminAuthorityInstructionAsync(input),
1039
+ getWithdrawInstruction(input, {
1040
+ programAddress:
1041
+ instructionConfig?.programAddress ?? config.programAddress,
1042
+ }),
953
1043
  ),
954
- withdraw: (input) =>
955
- addSelfPlanAndSendFunctions(client, getWithdrawInstruction(input)),
956
1044
  },
957
1045
  pdas: {
958
- adminConfig: findAdminConfigPda,
959
- position: findPositionPda,
960
- binArray: findBinArrayPda,
961
- pool: findPoolPda,
1046
+ adminConfig: (pdaConfig) =>
1047
+ findAdminConfigPda({
1048
+ programAddress:
1049
+ pdaConfig?.programAddress ?? config.programAddress,
1050
+ }),
1051
+ position: (seeds, pdaConfig) =>
1052
+ findPositionPda(seeds, {
1053
+ programAddress:
1054
+ pdaConfig?.programAddress ?? config.programAddress,
1055
+ }),
1056
+ binArray: (seeds, pdaConfig) =>
1057
+ findBinArrayPda(seeds, {
1058
+ programAddress:
1059
+ pdaConfig?.programAddress ?? config.programAddress,
1060
+ }),
1061
+ pool: (seeds, pdaConfig) =>
1062
+ findPoolPda(seeds, {
1063
+ programAddress:
1064
+ pdaConfig?.programAddress ?? config.programAddress,
1065
+ }),
962
1066
  },
963
1067
  identifyAccount: identifyPiconDlmmAccount,
964
1068
  identifyInstruction: identifyPiconDlmmInstruction,