@picon-finance/dlmm-sdk 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +48 -0
- package/dist/actions/accept_admin_authority.d.ts +13 -0
- package/dist/actions/accept_admin_authority.d.ts.map +1 -0
- package/dist/actions/accept_admin_authority.js +7 -0
- package/dist/actions/claim_fee.d.ts +21 -0
- package/dist/actions/claim_fee.d.ts.map +1 -0
- package/dist/actions/claim_fee.js +40 -0
- package/dist/actions/claim_multiple_fees.d.ts +19 -0
- package/dist/actions/claim_multiple_fees.d.ts.map +1 -0
- package/dist/actions/claim_multiple_fees.js +81 -0
- package/dist/actions/claim_protocol_fee.d.ts +18 -0
- package/dist/actions/claim_protocol_fee.d.ts.map +1 -0
- package/dist/actions/claim_protocol_fee.js +33 -0
- package/dist/actions/close_position.d.ts +14 -0
- package/dist/actions/close_position.d.ts.map +1 -0
- package/dist/actions/close_position.js +14 -0
- package/dist/actions/create_admin_config.d.ts +15 -0
- package/dist/actions/create_admin_config.d.ts.map +1 -0
- package/dist/actions/create_admin_config.js +30 -0
- package/dist/actions/create_bin_array.d.ts +16 -0
- package/dist/actions/create_bin_array.d.ts.map +1 -0
- package/dist/actions/create_bin_array.js +10 -0
- package/dist/actions/create_pool.d.ts +21 -0
- package/dist/actions/create_pool.d.ts.map +1 -0
- package/dist/actions/create_pool.js +22 -0
- package/dist/actions/delete_bin_array.d.ts +16 -0
- package/dist/actions/delete_bin_array.d.ts.map +1 -0
- package/dist/actions/delete_bin_array.js +13 -0
- package/dist/actions/deposit_by_weight.d.ts +27 -0
- package/dist/actions/deposit_by_weight.d.ts.map +1 -0
- package/dist/actions/deposit_by_weight.js +52 -0
- package/dist/actions/get_admin_config.d.ts +4 -0
- package/dist/actions/get_admin_config.d.ts.map +1 -0
- package/dist/actions/get_admin_config.js +7 -0
- package/dist/actions/get_bin_arrays_by_indices.d.ts +5 -0
- package/dist/actions/get_bin_arrays_by_indices.d.ts.map +1 -0
- package/dist/actions/get_bin_arrays_by_indices.js +6 -0
- package/dist/actions/get_pool.d.ts +4 -0
- package/dist/actions/get_pool.d.ts.map +1 -0
- package/dist/actions/get_pool.js +5 -0
- package/dist/actions/get_position.d.ts +4 -0
- package/dist/actions/get_position.d.ts.map +1 -0
- package/dist/actions/get_position.js +5 -0
- package/dist/actions/get_position_by_position_mint.d.ts +4 -0
- package/dist/actions/get_position_by_position_mint.d.ts.map +1 -0
- package/dist/actions/get_position_by_position_mint.js +6 -0
- package/dist/actions/get_positions_by_owner.d.ts +5 -0
- package/dist/actions/get_positions_by_owner.d.ts.map +1 -0
- package/dist/actions/get_positions_by_owner.js +33 -0
- package/dist/actions/get_positions_by_position_mints.d.ts +5 -0
- package/dist/actions/get_positions_by_position_mints.d.ts.map +1 -0
- package/dist/actions/get_positions_by_position_mints.js +9 -0
- package/dist/actions/helpers/build_swap_transaction_message.d.ts +22 -0
- package/dist/actions/helpers/build_swap_transaction_message.d.ts.map +1 -0
- package/dist/actions/helpers/build_swap_transaction_message.js +50 -0
- package/dist/actions/helpers/build_transaction_message.d.ts +20 -0
- package/dist/actions/helpers/build_transaction_message.d.ts.map +1 -0
- package/dist/actions/helpers/build_transaction_message.js +5 -0
- package/dist/actions/helpers/index.d.ts +8 -0
- package/dist/actions/helpers/index.d.ts.map +1 -0
- package/dist/actions/helpers/index.js +7 -0
- package/dist/actions/helpers/resolve_active_bin_and_mints.d.ts +12 -0
- package/dist/actions/helpers/resolve_active_bin_and_mints.d.ts.map +1 -0
- package/dist/actions/helpers/resolve_active_bin_and_mints.js +13 -0
- package/dist/actions/helpers/resolve_admin_config_address.d.ts +3 -0
- package/dist/actions/helpers/resolve_admin_config_address.d.ts.map +1 -0
- package/dist/actions/helpers/resolve_admin_config_address.js +9 -0
- package/dist/actions/helpers/resolve_mint_info.d.ts +10 -0
- package/dist/actions/helpers/resolve_mint_info.d.ts.map +1 -0
- package/dist/actions/helpers/resolve_mint_info.js +20 -0
- package/dist/actions/helpers/resolve_position_range.d.ts +12 -0
- package/dist/actions/helpers/resolve_position_range.d.ts.map +1 -0
- package/dist/actions/helpers/resolve_position_range.js +12 -0
- package/dist/actions/helpers/resolve_token_mints_and_programs.d.ts +15 -0
- package/dist/actions/helpers/resolve_token_mints_and_programs.d.ts.map +1 -0
- package/dist/actions/helpers/resolve_token_mints_and_programs.js +29 -0
- package/dist/actions/index.d.ts +31 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +28 -0
- package/dist/actions/is_admin_config_active.d.ts +4 -0
- package/dist/actions/is_admin_config_active.d.ts.map +1 -0
- package/dist/actions/is_admin_config_active.js +7 -0
- package/dist/actions/on_event.d.ts +11 -0
- package/dist/actions/on_event.d.ts.map +1 -0
- package/dist/actions/on_event.js +50 -0
- package/dist/actions/open_position.d.ts +17 -0
- package/dist/actions/open_position.d.ts.map +1 -0
- package/dist/actions/open_position.js +31 -0
- package/dist/actions/quote.d.ts +13 -0
- package/dist/actions/quote.d.ts.map +1 -0
- package/dist/actions/quote.js +43 -0
- package/dist/actions/set_metadata_update_authority.d.ts +14 -0
- package/dist/actions/set_metadata_update_authority.d.ts.map +1 -0
- package/dist/actions/set_metadata_update_authority.js +7 -0
- package/dist/actions/set_pool_dynamic_fee_config.d.ts +16 -0
- package/dist/actions/set_pool_dynamic_fee_config.d.ts.map +1 -0
- package/dist/actions/set_pool_dynamic_fee_config.js +7 -0
- package/dist/actions/set_pool_protocol_share.d.ts +15 -0
- package/dist/actions/set_pool_protocol_share.d.ts.map +1 -0
- package/dist/actions/set_pool_protocol_share.js +7 -0
- package/dist/actions/swap.d.ts +22 -0
- package/dist/actions/swap.d.ts.map +1 -0
- package/dist/actions/swap.js +19 -0
- package/dist/actions/sync_pool.d.ts +15 -0
- package/dist/actions/sync_pool.d.ts.map +1 -0
- package/dist/actions/sync_pool.js +26 -0
- package/dist/actions/transfer_admin_authority.d.ts +14 -0
- package/dist/actions/transfer_admin_authority.d.ts.map +1 -0
- package/dist/actions/transfer_admin_authority.js +7 -0
- package/dist/actions/withdraw.d.ts +22 -0
- package/dist/actions/withdraw.d.ts.map +1 -0
- package/dist/actions/withdraw.js +41 -0
- package/dist/events.d.ts +93 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +166 -0
- package/dist/generated/accounts/adminConfig.d.ts +35 -0
- package/dist/generated/accounts/adminConfig.d.ts.map +1 -0
- package/dist/generated/accounts/adminConfig.js +60 -0
- package/dist/generated/accounts/binArray.d.ts +40 -0
- package/dist/generated/accounts/binArray.d.ts.map +1 -0
- package/dist/generated/accounts/binArray.js +65 -0
- package/dist/generated/accounts/index.d.ts +12 -0
- package/dist/generated/accounts/index.d.ts.map +1 -0
- package/dist/generated/accounts/index.js +11 -0
- package/dist/generated/accounts/pool.d.ts +54 -0
- package/dist/generated/accounts/pool.d.ts.map +1 -0
- package/dist/generated/accounts/pool.js +79 -0
- package/dist/generated/accounts/position.d.ts +42 -0
- package/dist/generated/accounts/position.d.ts.map +1 -0
- package/dist/generated/accounts/position.js +67 -0
- package/dist/generated/errors/index.d.ts +9 -0
- package/dist/generated/errors/index.d.ts.map +1 -0
- package/dist/generated/errors/index.js +8 -0
- package/dist/generated/errors/piconDlmm.d.ts +58 -0
- package/dist/generated/errors/piconDlmm.d.ts.map +1 -0
- package/dist/generated/errors/piconDlmm.js +80 -0
- package/dist/generated/index.d.ts +14 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +13 -0
- package/dist/generated/instructions/acceptAdminAuthority.d.ts +47 -0
- package/dist/generated/instructions/acceptAdminAuthority.d.ts.map +1 -0
- package/dist/generated/instructions/acceptAdminAuthority.js +99 -0
- package/dist/generated/instructions/claimFee.d.ts +83 -0
- package/dist/generated/instructions/claimFee.d.ts.map +1 -0
- package/dist/generated/instructions/claimFee.js +127 -0
- package/dist/generated/instructions/claimProtocolFee.d.ts +83 -0
- package/dist/generated/instructions/claimProtocolFee.d.ts.map +1 -0
- package/dist/generated/instructions/claimProtocolFee.js +147 -0
- package/dist/generated/instructions/closePosition.d.ts +59 -0
- package/dist/generated/instructions/closePosition.d.ts.map +1 -0
- package/dist/generated/instructions/closePosition.js +124 -0
- package/dist/generated/instructions/createAdminConfig.d.ts +68 -0
- package/dist/generated/instructions/createAdminConfig.d.ts.map +1 -0
- package/dist/generated/instructions/createAdminConfig.js +132 -0
- package/dist/generated/instructions/createBinArray.d.ts +64 -0
- package/dist/generated/instructions/createBinArray.d.ts.map +1 -0
- package/dist/generated/instructions/createBinArray.js +122 -0
- package/dist/generated/instructions/createPool.d.ts +100 -0
- package/dist/generated/instructions/createPool.d.ts.map +1 -0
- package/dist/generated/instructions/createPool.js +202 -0
- package/dist/generated/instructions/deleteBinArray.d.ts +68 -0
- package/dist/generated/instructions/deleteBinArray.d.ts.map +1 -0
- package/dist/generated/instructions/deleteBinArray.js +130 -0
- package/dist/generated/instructions/depositByWeight.d.ts +99 -0
- package/dist/generated/instructions/depositByWeight.d.ts.map +1 -0
- package/dist/generated/instructions/depositByWeight.js +136 -0
- package/dist/generated/instructions/index.d.ts +25 -0
- package/dist/generated/instructions/index.d.ts.map +1 -0
- package/dist/generated/instructions/index.js +24 -0
- package/dist/generated/instructions/openPosition.d.ts +88 -0
- package/dist/generated/instructions/openPosition.d.ts.map +1 -0
- package/dist/generated/instructions/openPosition.js +200 -0
- package/dist/generated/instructions/setMetadataUpdateAuthority.d.ts +52 -0
- package/dist/generated/instructions/setMetadataUpdateAuthority.d.ts.map +1 -0
- package/dist/generated/instructions/setMetadataUpdateAuthority.js +98 -0
- package/dist/generated/instructions/setPoolDynamicFeeConfig.d.ts +57 -0
- package/dist/generated/instructions/setPoolDynamicFeeConfig.d.ts.map +1 -0
- package/dist/generated/instructions/setPoolDynamicFeeConfig.js +107 -0
- package/dist/generated/instructions/setPoolProtocolShare.d.ts +56 -0
- package/dist/generated/instructions/setPoolProtocolShare.d.ts.map +1 -0
- package/dist/generated/instructions/setPoolProtocolShare.js +106 -0
- package/dist/generated/instructions/swap.d.ts +74 -0
- package/dist/generated/instructions/swap.d.ts.map +1 -0
- package/dist/generated/instructions/swap.js +108 -0
- package/dist/generated/instructions/syncPool.d.ts +44 -0
- package/dist/generated/instructions/syncPool.d.ts.map +1 -0
- package/dist/generated/instructions/syncPool.js +71 -0
- package/dist/generated/instructions/transferAdminAuthority.d.ts +52 -0
- package/dist/generated/instructions/transferAdminAuthority.d.ts.map +1 -0
- package/dist/generated/instructions/transferAdminAuthority.js +98 -0
- package/dist/generated/instructions/withdraw.d.ts +86 -0
- package/dist/generated/instructions/withdraw.d.ts.map +1 -0
- package/dist/generated/instructions/withdraw.js +129 -0
- package/dist/generated/pdas/adminConfig.d.ts +12 -0
- package/dist/generated/pdas/adminConfig.d.ts.map +1 -0
- package/dist/generated/pdas/adminConfig.js +19 -0
- package/dist/generated/pdas/binArray.d.ts +16 -0
- package/dist/generated/pdas/binArray.d.ts.map +1 -0
- package/dist/generated/pdas/binArray.js +19 -0
- package/dist/generated/pdas/index.d.ts +12 -0
- package/dist/generated/pdas/index.d.ts.map +1 -0
- package/dist/generated/pdas/index.js +11 -0
- package/dist/generated/pdas/pool.d.ts +18 -0
- package/dist/generated/pdas/pool.d.ts.map +1 -0
- package/dist/generated/pdas/pool.js +21 -0
- package/dist/generated/pdas/position.d.ts +15 -0
- package/dist/generated/pdas/position.d.ts.map +1 -0
- package/dist/generated/pdas/position.js +18 -0
- package/dist/generated/programs/index.d.ts +9 -0
- package/dist/generated/programs/index.d.ts.map +1 -0
- package/dist/generated/programs/index.js +8 -0
- package/dist/generated/programs/piconDlmm.d.ts +126 -0
- package/dist/generated/programs/piconDlmm.d.ts.map +1 -0
- package/dist/generated/programs/piconDlmm.js +285 -0
- package/dist/generated/types/bin.d.ts +28 -0
- package/dist/generated/types/bin.d.ts.map +1 -0
- package/dist/generated/types/bin.js +31 -0
- package/dist/generated/types/distributionMode.d.ts +19 -0
- package/dist/generated/types/distributionMode.d.ts.map +1 -0
- package/dist/generated/types/distributionMode.js +24 -0
- package/dist/generated/types/dynamicFeeConfig.d.ts +29 -0
- package/dist/generated/types/dynamicFeeConfig.d.ts.map +1 -0
- package/dist/generated/types/dynamicFeeConfig.js +29 -0
- package/dist/generated/types/dynamicFeeState.d.ts +27 -0
- package/dist/generated/types/dynamicFeeState.d.ts.map +1 -0
- package/dist/generated/types/dynamicFeeState.js +30 -0
- package/dist/generated/types/feeState.d.ts +26 -0
- package/dist/generated/types/feeState.d.ts.map +1 -0
- package/dist/generated/types/feeState.js +29 -0
- package/dist/generated/types/index.d.ts +13 -0
- package/dist/generated/types/index.d.ts.map +1 -0
- package/dist/generated/types/index.js +12 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/picon_dlmm.json +2378 -0
- package/dist/program_addresses.d.ts +4 -0
- package/dist/program_addresses.d.ts.map +1 -0
- package/dist/program_addresses.js +8 -0
- package/dist/quote/index.d.ts +4 -0
- package/dist/quote/index.d.ts.map +1 -0
- package/dist/quote/index.js +5 -0
- package/dist/quote/wasm-node/picon_dlmm_quote.d.ts +6 -0
- package/dist/quote/wasm-node/picon_dlmm_quote.d.ts.map +1 -0
- package/dist/quote/wasm-node/picon_dlmm_quote.js +398 -0
- package/dist/quote/wasm-node/picon_dlmm_quote_bg.wasm +0 -0
- package/dist/quote/wasm-node-loader.d.ts +4 -0
- package/dist/quote/wasm-node-loader.d.ts.map +1 -0
- package/dist/quote/wasm-node-loader.js +7 -0
- package/dist/quote/wasm-web/picon_dlmm_quote.d.ts +9 -0
- package/dist/quote/wasm-web/picon_dlmm_quote.d.ts.map +1 -0
- package/dist/quote/wasm-web/picon_dlmm_quote.js +486 -0
- package/dist/quote/wasm-web/picon_dlmm_quote_bg.wasm +0 -0
- package/dist/quote/wasm-web-loader.d.ts +4 -0
- package/dist/quote/wasm-web-loader.d.ts.map +1 -0
- package/dist/quote/wasm-web-loader.js +12 -0
- package/dist/utils/admin_config.d.ts +3 -0
- package/dist/utils/admin_config.d.ts.map +1 -0
- package/dist/utils/admin_config.js +4 -0
- package/dist/utils/ata.d.ts +49 -0
- package/dist/utils/ata.d.ts.map +1 -0
- package/dist/utils/ata.js +113 -0
- package/dist/utils/bin_array.d.ts +8 -0
- package/dist/utils/bin_array.d.ts.map +1 -0
- package/dist/utils/bin_array.js +29 -0
- package/dist/utils/bin_location.d.ts +11 -0
- package/dist/utils/bin_location.d.ts.map +1 -0
- package/dist/utils/bin_location.js +55 -0
- package/dist/utils/chunk.d.ts +2 -0
- package/dist/utils/chunk.d.ts.map +1 -0
- package/dist/utils/chunk.js +7 -0
- package/dist/utils/compute_budget.d.ts +11 -0
- package/dist/utils/compute_budget.d.ts.map +1 -0
- package/dist/utils/compute_budget.js +22 -0
- package/dist/utils/constants.d.ts +12 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +20 -0
- package/dist/utils/transfer_fee.d.ts +4 -0
- package/dist/utils/transfer_fee.d.ts.map +1 -0
- package/dist/utils/transfer_fee.js +21 -0
- package/dist/utils/type_guards.d.ts +2 -0
- package/dist/utils/type_guards.d.ts.map +1 -0
- package/dist/utils/type_guards.js +3 -0
- package/package.json +59 -0
- package/src/actions/accept_admin_authority.ts +17 -0
- package/src/actions/claim_fee.ts +84 -0
- package/src/actions/claim_multiple_fees.ts +123 -0
- package/src/actions/claim_protocol_fee.ts +68 -0
- package/src/actions/close_position.ts +21 -0
- package/src/actions/create_admin_config.ts +50 -0
- package/src/actions/create_bin_array.ts +30 -0
- package/src/actions/create_pool.ts +49 -0
- package/src/actions/delete_bin_array.ts +33 -0
- package/src/actions/deposit_by_weight.ts +107 -0
- package/src/actions/get_admin_config.ts +13 -0
- package/src/actions/get_bin_arrays_by_indices.ts +15 -0
- package/src/actions/get_pool.ts +8 -0
- package/src/actions/get_position.ts +8 -0
- package/src/actions/get_position_by_position_mint.ts +14 -0
- package/src/actions/get_positions_by_owner.ts +48 -0
- package/src/actions/get_positions_by_position_mints.ts +21 -0
- package/src/actions/helpers/build_swap_transaction_message.ts +86 -0
- package/src/actions/helpers/build_transaction_message.ts +45 -0
- package/src/actions/helpers/index.ts +7 -0
- package/src/actions/helpers/resolve_active_bin_and_mints.ts +21 -0
- package/src/actions/helpers/resolve_admin_config_address.ts +11 -0
- package/src/actions/helpers/resolve_mint_info.ts +36 -0
- package/src/actions/helpers/resolve_position_range.ts +21 -0
- package/src/actions/helpers/resolve_token_mints_and_programs.ts +56 -0
- package/src/actions/index.ts +34 -0
- package/src/actions/is_admin_config_active.ts +14 -0
- package/src/actions/on_event.ts +78 -0
- package/src/actions/open_position.ts +66 -0
- package/src/actions/quote.ts +70 -0
- package/src/actions/set_metadata_update_authority.ts +17 -0
- package/src/actions/set_pool_dynamic_fee_config.ts +17 -0
- package/src/actions/set_pool_protocol_share.ts +17 -0
- package/src/actions/swap.ts +56 -0
- package/src/actions/sync_pool.ts +35 -0
- package/src/actions/transfer_admin_authority.ts +17 -0
- package/src/actions/withdraw.ts +87 -0
- package/src/events.ts +279 -0
- package/src/generated/accounts/adminConfig.ts +147 -0
- package/src/generated/accounts/binArray.ts +155 -0
- package/src/generated/accounts/index.ts +12 -0
- package/src/generated/accounts/pool.ts +192 -0
- package/src/generated/accounts/position.ts +164 -0
- package/src/generated/errors/index.ts +9 -0
- package/src/generated/errors/piconDlmm.ts +124 -0
- package/src/generated/index.ts +14 -0
- package/src/generated/instructions/acceptAdminAuthority.ts +262 -0
- package/src/generated/instructions/claimFee.ts +395 -0
- package/src/generated/instructions/claimProtocolFee.ts +462 -0
- package/src/generated/instructions/closePosition.ts +342 -0
- package/src/generated/instructions/createAdminConfig.ts +369 -0
- package/src/generated/instructions/createBinArray.ts +344 -0
- package/src/generated/instructions/createPool.ts +582 -0
- package/src/generated/instructions/deleteBinArray.ts +365 -0
- package/src/generated/instructions/depositByWeight.ts +435 -0
- package/src/generated/instructions/index.ts +25 -0
- package/src/generated/instructions/openPosition.ts +547 -0
- package/src/generated/instructions/setMetadataUpdateAuthority.ts +274 -0
- package/src/generated/instructions/setPoolDynamicFeeConfig.ts +304 -0
- package/src/generated/instructions/setPoolProtocolShare.ts +298 -0
- package/src/generated/instructions/swap.ts +336 -0
- package/src/generated/instructions/syncPool.ts +189 -0
- package/src/generated/instructions/transferAdminAuthority.ts +271 -0
- package/src/generated/instructions/withdraw.ts +402 -0
- package/src/generated/pdas/adminConfig.ts +32 -0
- package/src/generated/pdas/binArray.ts +40 -0
- package/src/generated/pdas/index.ts +12 -0
- package/src/generated/pdas/pool.ts +43 -0
- package/src/generated/pdas/position.ts +37 -0
- package/src/generated/programs/index.ts +9 -0
- package/src/generated/programs/piconDlmm.ts +803 -0
- package/src/generated/types/bin.ts +64 -0
- package/src/generated/types/distributionMode.ts +43 -0
- package/src/generated/types/dynamicFeeConfig.ts +69 -0
- package/src/generated/types/dynamicFeeState.ts +71 -0
- package/src/generated/types/feeState.ts +60 -0
- package/src/generated/types/index.ts +13 -0
- package/src/index.ts +4 -0
- package/src/picon_dlmm.json +2378 -0
- package/src/program_addresses.ts +10 -0
- package/src/quote/index.ts +14 -0
- package/src/quote/wasm-node/package.json +4 -0
- package/src/quote/wasm-node/picon_dlmm_quote.d.ts +64 -0
- package/src/quote/wasm-node/picon_dlmm_quote.js +407 -0
- package/src/quote/wasm-node/picon_dlmm_quote_bg.wasm +0 -0
- package/src/quote/wasm-node/picon_dlmm_quote_bg.wasm.d.ts +11 -0
- package/src/quote/wasm-node-loader.ts +11 -0
- package/src/quote/wasm-web/picon_dlmm_quote.d.ts +100 -0
- package/src/quote/wasm-web/picon_dlmm_quote.js +500 -0
- package/src/quote/wasm-web/picon_dlmm_quote_bg.wasm +0 -0
- package/src/quote/wasm-web/picon_dlmm_quote_bg.wasm.d.ts +11 -0
- package/src/quote/wasm-web-loader.ts +17 -0
- package/src/utils/admin_config.ts +6 -0
- package/src/utils/ata.ts +213 -0
- package/src/utils/bin_array.ts +45 -0
- package/src/utils/bin_location.ts +79 -0
- package/src/utils/chunk.ts +7 -0
- package/src/utils/compute_budget.ts +58 -0
- package/src/utils/constants.ts +24 -0
- package/src/utils/transfer_fee.ts +29 -0
- package/src/utils/type_guards.ts +3 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type ProgramDerivedAddress } from "@solana/kit";
|
|
9
|
+
export type PoolSeeds = {
|
|
10
|
+
tokenMintX: Address;
|
|
11
|
+
tokenMintY: Address;
|
|
12
|
+
binStep: number;
|
|
13
|
+
feeRate: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function findPoolPda(seeds: PoolSeeds, config?: {
|
|
16
|
+
programAddress?: Address | undefined;
|
|
17
|
+
}): Promise<ProgramDerivedAddress>;
|
|
18
|
+
//# sourceMappingURL=pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../../src/generated/pdas/pool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC3B,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAsB,WAAW,CAC/B,KAAK,EAAE,SAAS,EAChB,MAAM,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GACpD,OAAO,CAAC,qBAAqB,CAAC,CAchC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { getAddressEncoder, getBytesEncoder, getProgramDerivedAddress, getU16Encoder, getU32Encoder, } from "@solana/kit";
|
|
9
|
+
export async function findPoolPda(seeds, config = {}) {
|
|
10
|
+
const { programAddress = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC", } = config;
|
|
11
|
+
return await getProgramDerivedAddress({
|
|
12
|
+
programAddress,
|
|
13
|
+
seeds: [
|
|
14
|
+
getBytesEncoder().encode(new Uint8Array([112, 111, 111, 108])),
|
|
15
|
+
getAddressEncoder().encode(seeds.tokenMintX),
|
|
16
|
+
getAddressEncoder().encode(seeds.tokenMintY),
|
|
17
|
+
getU16Encoder().encode(seeds.binStep),
|
|
18
|
+
getU32Encoder().encode(seeds.feeRate),
|
|
19
|
+
],
|
|
20
|
+
});
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type ProgramDerivedAddress } from "@solana/kit";
|
|
9
|
+
export type PositionSeeds = {
|
|
10
|
+
positionMint: Address;
|
|
11
|
+
};
|
|
12
|
+
export declare function findPositionPda(seeds: PositionSeeds, config?: {
|
|
13
|
+
programAddress?: Address | undefined;
|
|
14
|
+
}): Promise<ProgramDerivedAddress>;
|
|
15
|
+
//# sourceMappingURL=position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../src/generated/pdas/position.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC3B,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG;IAC1B,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,wBAAsB,eAAe,CACnC,KAAK,EAAE,aAAa,EACpB,MAAM,GAAE;IAAE,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAAO,GACpD,OAAO,CAAC,qBAAqB,CAAC,CAahC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { getAddressEncoder, getBytesEncoder, getProgramDerivedAddress, } from "@solana/kit";
|
|
9
|
+
export async function findPositionPda(seeds, config = {}) {
|
|
10
|
+
const { programAddress = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC", } = config;
|
|
11
|
+
return await getProgramDerivedAddress({
|
|
12
|
+
programAddress,
|
|
13
|
+
seeds: [
|
|
14
|
+
getBytesEncoder().encode(new Uint8Array([112, 111, 115, 105, 116, 105, 111, 110])),
|
|
15
|
+
getAddressEncoder().encode(seeds.positionMint),
|
|
16
|
+
],
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
export * from "./piconDlmm";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/programs/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type Address, type ClientWithPayer, type ClientWithRpc, type ClientWithTransactionPlanning, type ClientWithTransactionSending, type ExtendedClient, type GetAccountInfoApi, type GetMultipleAccountsApi, type Instruction, type InstructionWithData, type ReadonlyUint8Array } from "@solana/kit";
|
|
9
|
+
import { type SelfFetchFunctions, type SelfPlanAndSendFunctions } from "@solana/program-client-core";
|
|
10
|
+
import { getAdminConfigCodec, getBinArrayCodec, getPoolCodec, getPositionCodec, type AdminConfig, type AdminConfigArgs, type BinArray, type BinArrayArgs, type Pool, type PoolArgs, type Position, type PositionArgs } from "../accounts";
|
|
11
|
+
import { getAcceptAdminAuthorityInstructionAsync, getClaimFeeInstruction, getClaimProtocolFeeInstructionAsync, getClosePositionInstructionAsync, getCreateAdminConfigInstructionAsync, getCreateBinArrayInstructionAsync, getCreatePoolInstructionAsync, getDeleteBinArrayInstructionAsync, getDepositByWeightInstruction, getOpenPositionInstructionAsync, getSetMetadataUpdateAuthorityInstructionAsync, getSetPoolDynamicFeeConfigInstructionAsync, getSetPoolProtocolShareInstructionAsync, getSwapInstruction, getSyncPoolInstruction, getTransferAdminAuthorityInstructionAsync, getWithdrawInstruction, type AcceptAdminAuthorityAsyncInput, type ClaimFeeInput, type ClaimProtocolFeeAsyncInput, type ClosePositionAsyncInput, type CreateAdminConfigAsyncInput, type CreateBinArrayAsyncInput, type CreatePoolAsyncInput, type DeleteBinArrayAsyncInput, type DepositByWeightInput, type OpenPositionAsyncInput, type ParsedAcceptAdminAuthorityInstruction, type ParsedClaimFeeInstruction, type ParsedClaimProtocolFeeInstruction, type ParsedClosePositionInstruction, type ParsedCreateAdminConfigInstruction, type ParsedCreateBinArrayInstruction, type ParsedCreatePoolInstruction, type ParsedDeleteBinArrayInstruction, type ParsedDepositByWeightInstruction, type ParsedOpenPositionInstruction, type ParsedSetMetadataUpdateAuthorityInstruction, type ParsedSetPoolDynamicFeeConfigInstruction, type ParsedSetPoolProtocolShareInstruction, type ParsedSwapInstruction, type ParsedSyncPoolInstruction, type ParsedTransferAdminAuthorityInstruction, type ParsedWithdrawInstruction, type SetMetadataUpdateAuthorityAsyncInput, type SetPoolDynamicFeeConfigAsyncInput, type SetPoolProtocolShareAsyncInput, type SwapInput, type SyncPoolInput, type TransferAdminAuthorityAsyncInput, type WithdrawInput } from "../instructions";
|
|
12
|
+
import { findAdminConfigPda, findBinArrayPda, findPoolPda, findPositionPda } from "../pdas";
|
|
13
|
+
export declare const PICON_DLMM_PROGRAM_ADDRESS: Address<"pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC">;
|
|
14
|
+
export declare enum PiconDlmmAccount {
|
|
15
|
+
AdminConfig = 0,
|
|
16
|
+
BinArray = 1,
|
|
17
|
+
Pool = 2,
|
|
18
|
+
Position = 3
|
|
19
|
+
}
|
|
20
|
+
export declare function identifyPiconDlmmAccount(account: {
|
|
21
|
+
data: ReadonlyUint8Array;
|
|
22
|
+
} | ReadonlyUint8Array): PiconDlmmAccount;
|
|
23
|
+
export declare enum PiconDlmmInstruction {
|
|
24
|
+
AcceptAdminAuthority = 0,
|
|
25
|
+
ClaimFee = 1,
|
|
26
|
+
ClaimProtocolFee = 2,
|
|
27
|
+
ClosePosition = 3,
|
|
28
|
+
CreateAdminConfig = 4,
|
|
29
|
+
CreateBinArray = 5,
|
|
30
|
+
CreatePool = 6,
|
|
31
|
+
DeleteBinArray = 7,
|
|
32
|
+
DepositByWeight = 8,
|
|
33
|
+
OpenPosition = 9,
|
|
34
|
+
SetMetadataUpdateAuthority = 10,
|
|
35
|
+
SetPoolDynamicFeeConfig = 11,
|
|
36
|
+
SetPoolProtocolShare = 12,
|
|
37
|
+
Swap = 13,
|
|
38
|
+
SyncPool = 14,
|
|
39
|
+
TransferAdminAuthority = 15,
|
|
40
|
+
Withdraw = 16
|
|
41
|
+
}
|
|
42
|
+
export declare function identifyPiconDlmmInstruction(instruction: {
|
|
43
|
+
data: ReadonlyUint8Array;
|
|
44
|
+
} | ReadonlyUint8Array): PiconDlmmInstruction;
|
|
45
|
+
export type ParsedPiconDlmmInstruction<TProgram extends string = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC"> = ({
|
|
46
|
+
instructionType: PiconDlmmInstruction.AcceptAdminAuthority;
|
|
47
|
+
} & ParsedAcceptAdminAuthorityInstruction<TProgram>) | ({
|
|
48
|
+
instructionType: PiconDlmmInstruction.ClaimFee;
|
|
49
|
+
} & ParsedClaimFeeInstruction<TProgram>) | ({
|
|
50
|
+
instructionType: PiconDlmmInstruction.ClaimProtocolFee;
|
|
51
|
+
} & ParsedClaimProtocolFeeInstruction<TProgram>) | ({
|
|
52
|
+
instructionType: PiconDlmmInstruction.ClosePosition;
|
|
53
|
+
} & ParsedClosePositionInstruction<TProgram>) | ({
|
|
54
|
+
instructionType: PiconDlmmInstruction.CreateAdminConfig;
|
|
55
|
+
} & ParsedCreateAdminConfigInstruction<TProgram>) | ({
|
|
56
|
+
instructionType: PiconDlmmInstruction.CreateBinArray;
|
|
57
|
+
} & ParsedCreateBinArrayInstruction<TProgram>) | ({
|
|
58
|
+
instructionType: PiconDlmmInstruction.CreatePool;
|
|
59
|
+
} & ParsedCreatePoolInstruction<TProgram>) | ({
|
|
60
|
+
instructionType: PiconDlmmInstruction.DeleteBinArray;
|
|
61
|
+
} & ParsedDeleteBinArrayInstruction<TProgram>) | ({
|
|
62
|
+
instructionType: PiconDlmmInstruction.DepositByWeight;
|
|
63
|
+
} & ParsedDepositByWeightInstruction<TProgram>) | ({
|
|
64
|
+
instructionType: PiconDlmmInstruction.OpenPosition;
|
|
65
|
+
} & ParsedOpenPositionInstruction<TProgram>) | ({
|
|
66
|
+
instructionType: PiconDlmmInstruction.SetMetadataUpdateAuthority;
|
|
67
|
+
} & ParsedSetMetadataUpdateAuthorityInstruction<TProgram>) | ({
|
|
68
|
+
instructionType: PiconDlmmInstruction.SetPoolDynamicFeeConfig;
|
|
69
|
+
} & ParsedSetPoolDynamicFeeConfigInstruction<TProgram>) | ({
|
|
70
|
+
instructionType: PiconDlmmInstruction.SetPoolProtocolShare;
|
|
71
|
+
} & ParsedSetPoolProtocolShareInstruction<TProgram>) | ({
|
|
72
|
+
instructionType: PiconDlmmInstruction.Swap;
|
|
73
|
+
} & ParsedSwapInstruction<TProgram>) | ({
|
|
74
|
+
instructionType: PiconDlmmInstruction.SyncPool;
|
|
75
|
+
} & ParsedSyncPoolInstruction<TProgram>) | ({
|
|
76
|
+
instructionType: PiconDlmmInstruction.TransferAdminAuthority;
|
|
77
|
+
} & ParsedTransferAdminAuthorityInstruction<TProgram>) | ({
|
|
78
|
+
instructionType: PiconDlmmInstruction.Withdraw;
|
|
79
|
+
} & ParsedWithdrawInstruction<TProgram>);
|
|
80
|
+
export declare function parsePiconDlmmInstruction<TProgram extends string>(instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>): ParsedPiconDlmmInstruction<TProgram>;
|
|
81
|
+
export type PiconDlmmPlugin = {
|
|
82
|
+
accounts: PiconDlmmPluginAccounts;
|
|
83
|
+
instructions: PiconDlmmPluginInstructions;
|
|
84
|
+
pdas: PiconDlmmPluginPdas;
|
|
85
|
+
identifyAccount: typeof identifyPiconDlmmAccount;
|
|
86
|
+
identifyInstruction: typeof identifyPiconDlmmInstruction;
|
|
87
|
+
parseInstruction: typeof parsePiconDlmmInstruction;
|
|
88
|
+
};
|
|
89
|
+
export type PiconDlmmPluginAccounts = {
|
|
90
|
+
adminConfig: ReturnType<typeof getAdminConfigCodec> & SelfFetchFunctions<AdminConfigArgs, AdminConfig>;
|
|
91
|
+
binArray: ReturnType<typeof getBinArrayCodec> & SelfFetchFunctions<BinArrayArgs, BinArray>;
|
|
92
|
+
pool: ReturnType<typeof getPoolCodec> & SelfFetchFunctions<PoolArgs, Pool>;
|
|
93
|
+
position: ReturnType<typeof getPositionCodec> & SelfFetchFunctions<PositionArgs, Position>;
|
|
94
|
+
};
|
|
95
|
+
export type PiconDlmmPluginInstructions = {
|
|
96
|
+
acceptAdminAuthority: (input: AcceptAdminAuthorityAsyncInput) => ReturnType<typeof getAcceptAdminAuthorityInstructionAsync> & SelfPlanAndSendFunctions;
|
|
97
|
+
claimFee: (input: ClaimFeeInput) => ReturnType<typeof getClaimFeeInstruction> & SelfPlanAndSendFunctions;
|
|
98
|
+
claimProtocolFee: (input: ClaimProtocolFeeAsyncInput) => ReturnType<typeof getClaimProtocolFeeInstructionAsync> & SelfPlanAndSendFunctions;
|
|
99
|
+
closePosition: (input: ClosePositionAsyncInput) => ReturnType<typeof getClosePositionInstructionAsync> & SelfPlanAndSendFunctions;
|
|
100
|
+
createAdminConfig: (input: CreateAdminConfigAsyncInput) => ReturnType<typeof getCreateAdminConfigInstructionAsync> & SelfPlanAndSendFunctions;
|
|
101
|
+
createBinArray: (input: MakeOptional<CreateBinArrayAsyncInput, "payer">) => ReturnType<typeof getCreateBinArrayInstructionAsync> & SelfPlanAndSendFunctions;
|
|
102
|
+
createPool: (input: CreatePoolAsyncInput) => ReturnType<typeof getCreatePoolInstructionAsync> & SelfPlanAndSendFunctions;
|
|
103
|
+
deleteBinArray: (input: DeleteBinArrayAsyncInput) => ReturnType<typeof getDeleteBinArrayInstructionAsync> & SelfPlanAndSendFunctions;
|
|
104
|
+
depositByWeight: (input: DepositByWeightInput) => ReturnType<typeof getDepositByWeightInstruction> & SelfPlanAndSendFunctions;
|
|
105
|
+
openPosition: (input: OpenPositionAsyncInput) => ReturnType<typeof getOpenPositionInstructionAsync> & SelfPlanAndSendFunctions;
|
|
106
|
+
setMetadataUpdateAuthority: (input: SetMetadataUpdateAuthorityAsyncInput) => ReturnType<typeof getSetMetadataUpdateAuthorityInstructionAsync> & SelfPlanAndSendFunctions;
|
|
107
|
+
setPoolDynamicFeeConfig: (input: SetPoolDynamicFeeConfigAsyncInput) => ReturnType<typeof getSetPoolDynamicFeeConfigInstructionAsync> & SelfPlanAndSendFunctions;
|
|
108
|
+
setPoolProtocolShare: (input: SetPoolProtocolShareAsyncInput) => ReturnType<typeof getSetPoolProtocolShareInstructionAsync> & SelfPlanAndSendFunctions;
|
|
109
|
+
swap: (input: SwapInput) => ReturnType<typeof getSwapInstruction> & SelfPlanAndSendFunctions;
|
|
110
|
+
syncPool: (input: SyncPoolInput) => ReturnType<typeof getSyncPoolInstruction> & SelfPlanAndSendFunctions;
|
|
111
|
+
transferAdminAuthority: (input: TransferAdminAuthorityAsyncInput) => ReturnType<typeof getTransferAdminAuthorityInstructionAsync> & SelfPlanAndSendFunctions;
|
|
112
|
+
withdraw: (input: WithdrawInput) => ReturnType<typeof getWithdrawInstruction> & SelfPlanAndSendFunctions;
|
|
113
|
+
};
|
|
114
|
+
export type PiconDlmmPluginPdas = {
|
|
115
|
+
adminConfig: typeof findAdminConfigPda;
|
|
116
|
+
position: typeof findPositionPda;
|
|
117
|
+
binArray: typeof findBinArrayPda;
|
|
118
|
+
pool: typeof findPoolPda;
|
|
119
|
+
};
|
|
120
|
+
export type PiconDlmmPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> & ClientWithPayer & ClientWithTransactionPlanning & ClientWithTransactionSending;
|
|
121
|
+
export declare function piconDlmmProgram(): <T extends PiconDlmmPluginRequirements>(client: T) => ExtendedClient<T, {
|
|
122
|
+
piconDlmm: PiconDlmmPlugin;
|
|
123
|
+
}>;
|
|
124
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=piconDlmm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"piconDlmm.d.ts","sourceRoot":"","sources":["../../../src/generated/programs/piconDlmm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAUL,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EACjC,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uCAAuC,EACvC,sBAAsB,EACtB,mCAAmC,EACnC,gCAAgC,EAChC,oCAAoC,EACpC,iCAAiC,EACjC,6BAA6B,EAC7B,iCAAiC,EACjC,6BAA6B,EAC7B,+BAA+B,EAC/B,6CAA6C,EAC7C,0CAA0C,EAC1C,uCAAuC,EACvC,kBAAkB,EAClB,sBAAsB,EACtB,yCAAyC,EACzC,sBAAsB,EAkBtB,KAAK,8BAA8B,EACnC,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,w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;CAC1B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,aAAa,CACrD,iBAAiB,GAAG,sBAAsB,CAC3C,GACC,eAAe,GACf,6BAA6B,GAC7B,4BAA4B,CAAC;AAE/B,wBAAgB,gBAAgB,KACtB,CAAC,SAAS,2BAA2B,UACnC,CAAC,KACR,cAAc,CAAC,CAAC,EAAE;IAAE,SAAS,EAAE,eAAe,CAAA;CAAE,CAAC,CAmGrD;AAED,KAAK,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { assertIsInstructionWithAccounts, containsBytes, extendClient, fixEncoderSize, getBytesEncoder, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, SolanaError, } from "@solana/kit";
|
|
9
|
+
import { addSelfFetchFunctions, addSelfPlanAndSendFunctions, } from "@solana/program-client-core";
|
|
10
|
+
import { getAdminConfigCodec, getBinArrayCodec, getPoolCodec, getPositionCodec, } from "../accounts";
|
|
11
|
+
import { getAcceptAdminAuthorityInstructionAsync, getClaimFeeInstruction, getClaimProtocolFeeInstructionAsync, getClosePositionInstructionAsync, getCreateAdminConfigInstructionAsync, getCreateBinArrayInstructionAsync, getCreatePoolInstructionAsync, getDeleteBinArrayInstructionAsync, getDepositByWeightInstruction, getOpenPositionInstructionAsync, getSetMetadataUpdateAuthorityInstructionAsync, getSetPoolDynamicFeeConfigInstructionAsync, getSetPoolProtocolShareInstructionAsync, getSwapInstruction, getSyncPoolInstruction, getTransferAdminAuthorityInstructionAsync, getWithdrawInstruction, parseAcceptAdminAuthorityInstruction, parseClaimFeeInstruction, parseClaimProtocolFeeInstruction, parseClosePositionInstruction, parseCreateAdminConfigInstruction, parseCreateBinArrayInstruction, parseCreatePoolInstruction, parseDeleteBinArrayInstruction, parseDepositByWeightInstruction, parseOpenPositionInstruction, parseSetMetadataUpdateAuthorityInstruction, parseSetPoolDynamicFeeConfigInstruction, parseSetPoolProtocolShareInstruction, parseSwapInstruction, parseSyncPoolInstruction, parseTransferAdminAuthorityInstruction, parseWithdrawInstruction, } from "../instructions";
|
|
12
|
+
import { findAdminConfigPda, findBinArrayPda, findPoolPda, findPositionPda, } from "../pdas";
|
|
13
|
+
export const PICON_DLMM_PROGRAM_ADDRESS = "pDLMMk3KW3CUSxE1Wgjhx3jSmm2spe6Ry7Mq2HT26rC";
|
|
14
|
+
export var PiconDlmmAccount;
|
|
15
|
+
(function (PiconDlmmAccount) {
|
|
16
|
+
PiconDlmmAccount[PiconDlmmAccount["AdminConfig"] = 0] = "AdminConfig";
|
|
17
|
+
PiconDlmmAccount[PiconDlmmAccount["BinArray"] = 1] = "BinArray";
|
|
18
|
+
PiconDlmmAccount[PiconDlmmAccount["Pool"] = 2] = "Pool";
|
|
19
|
+
PiconDlmmAccount[PiconDlmmAccount["Position"] = 3] = "Position";
|
|
20
|
+
})(PiconDlmmAccount || (PiconDlmmAccount = {}));
|
|
21
|
+
export function identifyPiconDlmmAccount(account) {
|
|
22
|
+
const data = "data" in account ? account.data : account;
|
|
23
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([156, 10, 79, 161, 71, 9, 62, 77])), 0)) {
|
|
24
|
+
return PiconDlmmAccount.AdminConfig;
|
|
25
|
+
}
|
|
26
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([92, 142, 92, 220, 5, 148, 70, 181])), 0)) {
|
|
27
|
+
return PiconDlmmAccount.BinArray;
|
|
28
|
+
}
|
|
29
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([241, 154, 109, 4, 17, 177, 109, 188])), 0)) {
|
|
30
|
+
return PiconDlmmAccount.Pool;
|
|
31
|
+
}
|
|
32
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([170, 188, 143, 228, 122, 64, 247, 208])), 0)) {
|
|
33
|
+
return PiconDlmmAccount.Position;
|
|
34
|
+
}
|
|
35
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, { accountData: data, programName: "piconDlmm" });
|
|
36
|
+
}
|
|
37
|
+
export var PiconDlmmInstruction;
|
|
38
|
+
(function (PiconDlmmInstruction) {
|
|
39
|
+
PiconDlmmInstruction[PiconDlmmInstruction["AcceptAdminAuthority"] = 0] = "AcceptAdminAuthority";
|
|
40
|
+
PiconDlmmInstruction[PiconDlmmInstruction["ClaimFee"] = 1] = "ClaimFee";
|
|
41
|
+
PiconDlmmInstruction[PiconDlmmInstruction["ClaimProtocolFee"] = 2] = "ClaimProtocolFee";
|
|
42
|
+
PiconDlmmInstruction[PiconDlmmInstruction["ClosePosition"] = 3] = "ClosePosition";
|
|
43
|
+
PiconDlmmInstruction[PiconDlmmInstruction["CreateAdminConfig"] = 4] = "CreateAdminConfig";
|
|
44
|
+
PiconDlmmInstruction[PiconDlmmInstruction["CreateBinArray"] = 5] = "CreateBinArray";
|
|
45
|
+
PiconDlmmInstruction[PiconDlmmInstruction["CreatePool"] = 6] = "CreatePool";
|
|
46
|
+
PiconDlmmInstruction[PiconDlmmInstruction["DeleteBinArray"] = 7] = "DeleteBinArray";
|
|
47
|
+
PiconDlmmInstruction[PiconDlmmInstruction["DepositByWeight"] = 8] = "DepositByWeight";
|
|
48
|
+
PiconDlmmInstruction[PiconDlmmInstruction["OpenPosition"] = 9] = "OpenPosition";
|
|
49
|
+
PiconDlmmInstruction[PiconDlmmInstruction["SetMetadataUpdateAuthority"] = 10] = "SetMetadataUpdateAuthority";
|
|
50
|
+
PiconDlmmInstruction[PiconDlmmInstruction["SetPoolDynamicFeeConfig"] = 11] = "SetPoolDynamicFeeConfig";
|
|
51
|
+
PiconDlmmInstruction[PiconDlmmInstruction["SetPoolProtocolShare"] = 12] = "SetPoolProtocolShare";
|
|
52
|
+
PiconDlmmInstruction[PiconDlmmInstruction["Swap"] = 13] = "Swap";
|
|
53
|
+
PiconDlmmInstruction[PiconDlmmInstruction["SyncPool"] = 14] = "SyncPool";
|
|
54
|
+
PiconDlmmInstruction[PiconDlmmInstruction["TransferAdminAuthority"] = 15] = "TransferAdminAuthority";
|
|
55
|
+
PiconDlmmInstruction[PiconDlmmInstruction["Withdraw"] = 16] = "Withdraw";
|
|
56
|
+
})(PiconDlmmInstruction || (PiconDlmmInstruction = {}));
|
|
57
|
+
export function identifyPiconDlmmInstruction(instruction) {
|
|
58
|
+
const data = "data" in instruction ? instruction.data : instruction;
|
|
59
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([109, 115, 12, 245, 11, 10, 16, 209])), 0)) {
|
|
60
|
+
return PiconDlmmInstruction.AcceptAdminAuthority;
|
|
61
|
+
}
|
|
62
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([169, 32, 79, 137, 136, 232, 70, 137])), 0)) {
|
|
63
|
+
return PiconDlmmInstruction.ClaimFee;
|
|
64
|
+
}
|
|
65
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([165, 228, 133, 48, 99, 249, 255, 33])), 0)) {
|
|
66
|
+
return PiconDlmmInstruction.ClaimProtocolFee;
|
|
67
|
+
}
|
|
68
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([123, 134, 81, 0, 49, 68, 98, 98])), 0)) {
|
|
69
|
+
return PiconDlmmInstruction.ClosePosition;
|
|
70
|
+
}
|
|
71
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([19, 140, 214, 88, 151, 236, 89, 5])), 0)) {
|
|
72
|
+
return PiconDlmmInstruction.CreateAdminConfig;
|
|
73
|
+
}
|
|
74
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([107, 26, 23, 62, 137, 213, 131, 235])), 0)) {
|
|
75
|
+
return PiconDlmmInstruction.CreateBinArray;
|
|
76
|
+
}
|
|
77
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([233, 146, 209, 142, 207, 104, 64, 188])), 0)) {
|
|
78
|
+
return PiconDlmmInstruction.CreatePool;
|
|
79
|
+
}
|
|
80
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([158, 86, 142, 160, 52, 53, 194, 51])), 0)) {
|
|
81
|
+
return PiconDlmmInstruction.DeleteBinArray;
|
|
82
|
+
}
|
|
83
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([121, 187, 132, 201, 131, 190, 200, 124])), 0)) {
|
|
84
|
+
return PiconDlmmInstruction.DepositByWeight;
|
|
85
|
+
}
|
|
86
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([135, 128, 47, 77, 15, 152, 240, 49])), 0)) {
|
|
87
|
+
return PiconDlmmInstruction.OpenPosition;
|
|
88
|
+
}
|
|
89
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([82, 181, 7, 62, 133, 40, 2, 109])), 0)) {
|
|
90
|
+
return PiconDlmmInstruction.SetMetadataUpdateAuthority;
|
|
91
|
+
}
|
|
92
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([44, 189, 119, 222, 246, 2, 137, 85])), 0)) {
|
|
93
|
+
return PiconDlmmInstruction.SetPoolDynamicFeeConfig;
|
|
94
|
+
}
|
|
95
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([16, 138, 62, 186, 255, 137, 75, 193])), 0)) {
|
|
96
|
+
return PiconDlmmInstruction.SetPoolProtocolShare;
|
|
97
|
+
}
|
|
98
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([248, 198, 158, 145, 225, 117, 135, 200])), 0)) {
|
|
99
|
+
return PiconDlmmInstruction.Swap;
|
|
100
|
+
}
|
|
101
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([219, 251, 215, 251, 44, 37, 108, 102])), 0)) {
|
|
102
|
+
return PiconDlmmInstruction.SyncPool;
|
|
103
|
+
}
|
|
104
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([198, 11, 182, 207, 145, 11, 135, 215])), 0)) {
|
|
105
|
+
return PiconDlmmInstruction.TransferAdminAuthority;
|
|
106
|
+
}
|
|
107
|
+
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([183, 18, 70, 156, 148, 109, 161, 34])), 0)) {
|
|
108
|
+
return PiconDlmmInstruction.Withdraw;
|
|
109
|
+
}
|
|
110
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, { instructionData: data, programName: "piconDlmm" });
|
|
111
|
+
}
|
|
112
|
+
export function parsePiconDlmmInstruction(instruction) {
|
|
113
|
+
const instructionType = identifyPiconDlmmInstruction(instruction);
|
|
114
|
+
switch (instructionType) {
|
|
115
|
+
case PiconDlmmInstruction.AcceptAdminAuthority: {
|
|
116
|
+
assertIsInstructionWithAccounts(instruction);
|
|
117
|
+
return {
|
|
118
|
+
instructionType: PiconDlmmInstruction.AcceptAdminAuthority,
|
|
119
|
+
...parseAcceptAdminAuthorityInstruction(instruction),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
case PiconDlmmInstruction.ClaimFee: {
|
|
123
|
+
assertIsInstructionWithAccounts(instruction);
|
|
124
|
+
return {
|
|
125
|
+
instructionType: PiconDlmmInstruction.ClaimFee,
|
|
126
|
+
...parseClaimFeeInstruction(instruction),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
case PiconDlmmInstruction.ClaimProtocolFee: {
|
|
130
|
+
assertIsInstructionWithAccounts(instruction);
|
|
131
|
+
return {
|
|
132
|
+
instructionType: PiconDlmmInstruction.ClaimProtocolFee,
|
|
133
|
+
...parseClaimProtocolFeeInstruction(instruction),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
case PiconDlmmInstruction.ClosePosition: {
|
|
137
|
+
assertIsInstructionWithAccounts(instruction);
|
|
138
|
+
return {
|
|
139
|
+
instructionType: PiconDlmmInstruction.ClosePosition,
|
|
140
|
+
...parseClosePositionInstruction(instruction),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
case PiconDlmmInstruction.CreateAdminConfig: {
|
|
144
|
+
assertIsInstructionWithAccounts(instruction);
|
|
145
|
+
return {
|
|
146
|
+
instructionType: PiconDlmmInstruction.CreateAdminConfig,
|
|
147
|
+
...parseCreateAdminConfigInstruction(instruction),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
case PiconDlmmInstruction.CreateBinArray: {
|
|
151
|
+
assertIsInstructionWithAccounts(instruction);
|
|
152
|
+
return {
|
|
153
|
+
instructionType: PiconDlmmInstruction.CreateBinArray,
|
|
154
|
+
...parseCreateBinArrayInstruction(instruction),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
case PiconDlmmInstruction.CreatePool: {
|
|
158
|
+
assertIsInstructionWithAccounts(instruction);
|
|
159
|
+
return {
|
|
160
|
+
instructionType: PiconDlmmInstruction.CreatePool,
|
|
161
|
+
...parseCreatePoolInstruction(instruction),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
case PiconDlmmInstruction.DeleteBinArray: {
|
|
165
|
+
assertIsInstructionWithAccounts(instruction);
|
|
166
|
+
return {
|
|
167
|
+
instructionType: PiconDlmmInstruction.DeleteBinArray,
|
|
168
|
+
...parseDeleteBinArrayInstruction(instruction),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
case PiconDlmmInstruction.DepositByWeight: {
|
|
172
|
+
assertIsInstructionWithAccounts(instruction);
|
|
173
|
+
return {
|
|
174
|
+
instructionType: PiconDlmmInstruction.DepositByWeight,
|
|
175
|
+
...parseDepositByWeightInstruction(instruction),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
case PiconDlmmInstruction.OpenPosition: {
|
|
179
|
+
assertIsInstructionWithAccounts(instruction);
|
|
180
|
+
return {
|
|
181
|
+
instructionType: PiconDlmmInstruction.OpenPosition,
|
|
182
|
+
...parseOpenPositionInstruction(instruction),
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
case PiconDlmmInstruction.SetMetadataUpdateAuthority: {
|
|
186
|
+
assertIsInstructionWithAccounts(instruction);
|
|
187
|
+
return {
|
|
188
|
+
instructionType: PiconDlmmInstruction.SetMetadataUpdateAuthority,
|
|
189
|
+
...parseSetMetadataUpdateAuthorityInstruction(instruction),
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
case PiconDlmmInstruction.SetPoolDynamicFeeConfig: {
|
|
193
|
+
assertIsInstructionWithAccounts(instruction);
|
|
194
|
+
return {
|
|
195
|
+
instructionType: PiconDlmmInstruction.SetPoolDynamicFeeConfig,
|
|
196
|
+
...parseSetPoolDynamicFeeConfigInstruction(instruction),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
case PiconDlmmInstruction.SetPoolProtocolShare: {
|
|
200
|
+
assertIsInstructionWithAccounts(instruction);
|
|
201
|
+
return {
|
|
202
|
+
instructionType: PiconDlmmInstruction.SetPoolProtocolShare,
|
|
203
|
+
...parseSetPoolProtocolShareInstruction(instruction),
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
case PiconDlmmInstruction.Swap: {
|
|
207
|
+
assertIsInstructionWithAccounts(instruction);
|
|
208
|
+
return {
|
|
209
|
+
instructionType: PiconDlmmInstruction.Swap,
|
|
210
|
+
...parseSwapInstruction(instruction),
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
case PiconDlmmInstruction.SyncPool: {
|
|
214
|
+
assertIsInstructionWithAccounts(instruction);
|
|
215
|
+
return {
|
|
216
|
+
instructionType: PiconDlmmInstruction.SyncPool,
|
|
217
|
+
...parseSyncPoolInstruction(instruction),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
case PiconDlmmInstruction.TransferAdminAuthority: {
|
|
221
|
+
assertIsInstructionWithAccounts(instruction);
|
|
222
|
+
return {
|
|
223
|
+
instructionType: PiconDlmmInstruction.TransferAdminAuthority,
|
|
224
|
+
...parseTransferAdminAuthorityInstruction(instruction),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
case PiconDlmmInstruction.Withdraw: {
|
|
228
|
+
assertIsInstructionWithAccounts(instruction);
|
|
229
|
+
return {
|
|
230
|
+
instructionType: PiconDlmmInstruction.Withdraw,
|
|
231
|
+
...parseWithdrawInstruction(instruction),
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
default:
|
|
235
|
+
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
|
|
236
|
+
instructionType: instructionType,
|
|
237
|
+
programName: "piconDlmm",
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
export function piconDlmmProgram() {
|
|
242
|
+
return (client) => {
|
|
243
|
+
return extendClient(client, {
|
|
244
|
+
piconDlmm: {
|
|
245
|
+
accounts: {
|
|
246
|
+
adminConfig: addSelfFetchFunctions(client, getAdminConfigCodec()),
|
|
247
|
+
binArray: addSelfFetchFunctions(client, getBinArrayCodec()),
|
|
248
|
+
pool: addSelfFetchFunctions(client, getPoolCodec()),
|
|
249
|
+
position: addSelfFetchFunctions(client, getPositionCodec()),
|
|
250
|
+
},
|
|
251
|
+
instructions: {
|
|
252
|
+
acceptAdminAuthority: (input) => addSelfPlanAndSendFunctions(client, getAcceptAdminAuthorityInstructionAsync(input)),
|
|
253
|
+
claimFee: (input) => addSelfPlanAndSendFunctions(client, getClaimFeeInstruction(input)),
|
|
254
|
+
claimProtocolFee: (input) => addSelfPlanAndSendFunctions(client, getClaimProtocolFeeInstructionAsync(input)),
|
|
255
|
+
closePosition: (input) => addSelfPlanAndSendFunctions(client, getClosePositionInstructionAsync(input)),
|
|
256
|
+
createAdminConfig: (input) => addSelfPlanAndSendFunctions(client, getCreateAdminConfigInstructionAsync(input)),
|
|
257
|
+
createBinArray: (input) => addSelfPlanAndSendFunctions(client, getCreateBinArrayInstructionAsync({
|
|
258
|
+
...input,
|
|
259
|
+
payer: input.payer ?? client.payer,
|
|
260
|
+
})),
|
|
261
|
+
createPool: (input) => addSelfPlanAndSendFunctions(client, getCreatePoolInstructionAsync(input)),
|
|
262
|
+
deleteBinArray: (input) => addSelfPlanAndSendFunctions(client, getDeleteBinArrayInstructionAsync(input)),
|
|
263
|
+
depositByWeight: (input) => addSelfPlanAndSendFunctions(client, getDepositByWeightInstruction(input)),
|
|
264
|
+
openPosition: (input) => addSelfPlanAndSendFunctions(client, getOpenPositionInstructionAsync(input)),
|
|
265
|
+
setMetadataUpdateAuthority: (input) => addSelfPlanAndSendFunctions(client, getSetMetadataUpdateAuthorityInstructionAsync(input)),
|
|
266
|
+
setPoolDynamicFeeConfig: (input) => addSelfPlanAndSendFunctions(client, getSetPoolDynamicFeeConfigInstructionAsync(input)),
|
|
267
|
+
setPoolProtocolShare: (input) => addSelfPlanAndSendFunctions(client, getSetPoolProtocolShareInstructionAsync(input)),
|
|
268
|
+
swap: (input) => addSelfPlanAndSendFunctions(client, getSwapInstruction(input)),
|
|
269
|
+
syncPool: (input) => addSelfPlanAndSendFunctions(client, getSyncPoolInstruction(input)),
|
|
270
|
+
transferAdminAuthority: (input) => addSelfPlanAndSendFunctions(client, getTransferAdminAuthorityInstructionAsync(input)),
|
|
271
|
+
withdraw: (input) => addSelfPlanAndSendFunctions(client, getWithdrawInstruction(input)),
|
|
272
|
+
},
|
|
273
|
+
pdas: {
|
|
274
|
+
adminConfig: findAdminConfigPda,
|
|
275
|
+
position: findPositionPda,
|
|
276
|
+
binArray: findBinArrayPda,
|
|
277
|
+
pool: findPoolPda,
|
|
278
|
+
},
|
|
279
|
+
identifyAccount: identifyPiconDlmmAccount,
|
|
280
|
+
identifyInstruction: identifyPiconDlmmInstruction,
|
|
281
|
+
parseInstruction: parsePiconDlmmInstruction,
|
|
282
|
+
},
|
|
283
|
+
});
|
|
284
|
+
};
|
|
285
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
export type Bin = {
|
|
10
|
+
amountX: bigint;
|
|
11
|
+
amountY: bigint;
|
|
12
|
+
price: bigint;
|
|
13
|
+
totalShares: bigint;
|
|
14
|
+
feePerShareX: bigint;
|
|
15
|
+
feePerShareY: bigint;
|
|
16
|
+
};
|
|
17
|
+
export type BinArgs = {
|
|
18
|
+
amountX: number | bigint;
|
|
19
|
+
amountY: number | bigint;
|
|
20
|
+
price: number | bigint;
|
|
21
|
+
totalShares: number | bigint;
|
|
22
|
+
feePerShareX: number | bigint;
|
|
23
|
+
feePerShareY: number | bigint;
|
|
24
|
+
};
|
|
25
|
+
export declare function getBinEncoder(): FixedSizeEncoder<BinArgs>;
|
|
26
|
+
export declare function getBinDecoder(): FixedSizeDecoder<Bin>;
|
|
27
|
+
export declare function getBinCodec(): FixedSizeCodec<BinArgs, Bin>;
|
|
28
|
+
//# sourceMappingURL=bin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../../src/generated/types/bin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,GAAG,GAAG;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B,CAAC;AAEF,wBAAgB,aAAa,IAAI,gBAAgB,CAAC,OAAO,CAAC,CASzD;AAED,wBAAgB,aAAa,IAAI,gBAAgB,CAAC,GAAG,CAAC,CASrD;AAED,wBAAgB,WAAW,IAAI,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,CAE1D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { combineCodec, getStructDecoder, getStructEncoder, getU128Decoder, getU128Encoder, getU64Decoder, getU64Encoder, } from "@solana/kit";
|
|
9
|
+
export function getBinEncoder() {
|
|
10
|
+
return getStructEncoder([
|
|
11
|
+
["amountX", getU64Encoder()],
|
|
12
|
+
["amountY", getU64Encoder()],
|
|
13
|
+
["price", getU128Encoder()],
|
|
14
|
+
["totalShares", getU128Encoder()],
|
|
15
|
+
["feePerShareX", getU128Encoder()],
|
|
16
|
+
["feePerShareY", getU128Encoder()],
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
export function getBinDecoder() {
|
|
20
|
+
return getStructDecoder([
|
|
21
|
+
["amountX", getU64Decoder()],
|
|
22
|
+
["amountY", getU64Decoder()],
|
|
23
|
+
["price", getU128Decoder()],
|
|
24
|
+
["totalShares", getU128Decoder()],
|
|
25
|
+
["feePerShareX", getU128Decoder()],
|
|
26
|
+
["feePerShareY", getU128Decoder()],
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
export function getBinCodec() {
|
|
30
|
+
return combineCodec(getBinEncoder(), getBinDecoder());
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder } from "@solana/kit";
|
|
9
|
+
export declare enum DistributionMode {
|
|
10
|
+
Balanced = 0,
|
|
11
|
+
Unbalanced = 1,
|
|
12
|
+
UnbalancedX = 2,
|
|
13
|
+
UnbalancedY = 3
|
|
14
|
+
}
|
|
15
|
+
export type DistributionModeArgs = DistributionMode;
|
|
16
|
+
export declare function getDistributionModeEncoder(): FixedSizeEncoder<DistributionModeArgs>;
|
|
17
|
+
export declare function getDistributionModeDecoder(): FixedSizeDecoder<DistributionMode>;
|
|
18
|
+
export declare function getDistributionModeCodec(): FixedSizeCodec<DistributionModeArgs, DistributionMode>;
|
|
19
|
+
//# sourceMappingURL=distributionMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distributionMode.d.ts","sourceRoot":"","sources":["../../../src/generated/types/distributionMode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAErB,oBAAY,gBAAgB;IAC1B,QAAQ,IAAA;IACR,UAAU,IAAA;IACV,WAAW,IAAA;IACX,WAAW,IAAA;CACZ;AAED,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAEpD,wBAAgB,0BAA0B,IAAI,gBAAgB,CAAC,oBAAoB,CAAC,CAEnF;AAED,wBAAgB,0BAA0B,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,CAE/E;AAED,wBAAgB,wBAAwB,IAAI,cAAc,CACxD,oBAAoB,EACpB,gBAAgB,CACjB,CAKA"}
|