@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 @@
|
|
|
1
|
+
{"version":3,"file":"program_addresses.d.ts","sourceRoot":"","sources":["../src/program_addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAW,MAAM,aAAa,CAAC;AAKpD,OAAO,EAAE,0BAA0B,IAAI,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAIpF,eAAO,MAAM,sBAAsB,EAAE,OAAgE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { address } from "@solana/kit";
|
|
2
|
+
// SDK codegen always targets the mainnet IDL (see package.json's `copy-idl`), so this is the
|
|
3
|
+
// same value as `generated.PICON_DLMM_PROGRAM_ADDRESS` — exported under a clearer name here
|
|
4
|
+
// since it's meant to be read standalone, not discovered via the generated namespace.
|
|
5
|
+
export { PICON_DLMM_PROGRAM_ADDRESS as MAINNET_PROGRAM_ADDRESS } from "./generated";
|
|
6
|
+
// Not baked into codegen (the IDL's structure is identical across clusters — only the address
|
|
7
|
+
// differs) — pass this as the `programAddress` argument on any SDK action to target devnet.
|
|
8
|
+
export const DEVNET_PROGRAM_ADDRESS = address("tDLMMKoxBt7UkZapYHsEgLGydmFvSQXh5mGzrRovoeM");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/quote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AAEhE,wBAAsB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAGnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picon_dlmm_quote.d.ts","sourceRoot":"","sources":["../../../src/quote/wasm-node/picon_dlmm_quote.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAHhB,UAGgB,GAFd,WAAW,CAQvB"}
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/* @ts-self-types="./picon_dlmm_quote.d.ts" */
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
/**
|
|
4
|
+
* @param {QuoteInput} input
|
|
5
|
+
* @returns {QuoteOutput}
|
|
6
|
+
*/
|
|
7
|
+
export function quote(input) {
|
|
8
|
+
const ret = wasm.quote(input);
|
|
9
|
+
if (ret[2]) {
|
|
10
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11
|
+
}
|
|
12
|
+
return takeFromExternrefTable0(ret[0]);
|
|
13
|
+
}
|
|
14
|
+
function __wbg_get_imports() {
|
|
15
|
+
const import0 = {
|
|
16
|
+
__proto__: null,
|
|
17
|
+
__wbg_Error_92b29b0548f8b746: function (arg0, arg1) {
|
|
18
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
19
|
+
return ret;
|
|
20
|
+
},
|
|
21
|
+
__wbg_Number_9a4e0ecb0fa16705: function (arg0) {
|
|
22
|
+
const ret = Number(arg0);
|
|
23
|
+
return ret;
|
|
24
|
+
},
|
|
25
|
+
__wbg_String_8564e559799eccda: function (arg0, arg1) {
|
|
26
|
+
const ret = String(arg1);
|
|
27
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28
|
+
const len1 = WASM_VECTOR_LEN;
|
|
29
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
30
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
31
|
+
},
|
|
32
|
+
__wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function (arg0, arg1) {
|
|
33
|
+
const v = arg1;
|
|
34
|
+
const ret = typeof (v) === 'bigint' ? v : undefined;
|
|
35
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
36
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
37
|
+
},
|
|
38
|
+
__wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function (arg0) {
|
|
39
|
+
const v = arg0;
|
|
40
|
+
const ret = typeof (v) === 'boolean' ? v : undefined;
|
|
41
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
42
|
+
},
|
|
43
|
+
__wbg___wbindgen_debug_string_c25d447a39f5578f: function (arg0, arg1) {
|
|
44
|
+
const ret = debugString(arg1);
|
|
45
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
46
|
+
const len1 = WASM_VECTOR_LEN;
|
|
47
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
48
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
49
|
+
},
|
|
50
|
+
__wbg___wbindgen_in_aca499c5de7ff5e5: function (arg0, arg1) {
|
|
51
|
+
const ret = arg0 in arg1;
|
|
52
|
+
return ret;
|
|
53
|
+
},
|
|
54
|
+
__wbg___wbindgen_is_bigint_2f76dc55065b4273: function (arg0) {
|
|
55
|
+
const ret = typeof (arg0) === 'bigint';
|
|
56
|
+
return ret;
|
|
57
|
+
},
|
|
58
|
+
__wbg___wbindgen_is_function_1ff95bcc5517c252: function (arg0) {
|
|
59
|
+
const ret = typeof (arg0) === 'function';
|
|
60
|
+
return ret;
|
|
61
|
+
},
|
|
62
|
+
__wbg___wbindgen_is_object_a27215656b807791: function (arg0) {
|
|
63
|
+
const val = arg0;
|
|
64
|
+
const ret = typeof (val) === 'object' && val !== null;
|
|
65
|
+
return ret;
|
|
66
|
+
},
|
|
67
|
+
__wbg___wbindgen_is_undefined_c05833b95a3cf397: function (arg0) {
|
|
68
|
+
const ret = arg0 === undefined;
|
|
69
|
+
return ret;
|
|
70
|
+
},
|
|
71
|
+
__wbg___wbindgen_jsval_eq_e659fcf7b0e32763: function (arg0, arg1) {
|
|
72
|
+
const ret = arg0 === arg1;
|
|
73
|
+
return ret;
|
|
74
|
+
},
|
|
75
|
+
__wbg___wbindgen_jsval_loose_eq_db4c3b15f63fc170: function (arg0, arg1) {
|
|
76
|
+
const ret = arg0 == arg1;
|
|
77
|
+
return ret;
|
|
78
|
+
},
|
|
79
|
+
__wbg___wbindgen_number_get_394265ed1e1b84ee: function (arg0, arg1) {
|
|
80
|
+
const obj = arg1;
|
|
81
|
+
const ret = typeof (obj) === 'number' ? obj : undefined;
|
|
82
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
83
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
84
|
+
},
|
|
85
|
+
__wbg___wbindgen_shr_ad10001a7b001d7f: function (arg0, arg1) {
|
|
86
|
+
const ret = arg0 >> arg1;
|
|
87
|
+
return ret;
|
|
88
|
+
},
|
|
89
|
+
__wbg___wbindgen_string_get_b0ca35b86a603356: function (arg0, arg1) {
|
|
90
|
+
const obj = arg1;
|
|
91
|
+
const ret = typeof (obj) === 'string' ? obj : undefined;
|
|
92
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
93
|
+
var len1 = WASM_VECTOR_LEN;
|
|
94
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
95
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
96
|
+
},
|
|
97
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function (arg0, arg1) {
|
|
98
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
99
|
+
},
|
|
100
|
+
__wbg_call_8a2dd23819f8a60a: function () {
|
|
101
|
+
return handleError(function (arg0, arg1) {
|
|
102
|
+
const ret = arg0.call(arg1);
|
|
103
|
+
return ret;
|
|
104
|
+
}, arguments);
|
|
105
|
+
},
|
|
106
|
+
__wbg_done_89b2b13e91a60321: function (arg0) {
|
|
107
|
+
const ret = arg0.done;
|
|
108
|
+
return ret;
|
|
109
|
+
},
|
|
110
|
+
__wbg_get_c7eb1f358a7654df: function () {
|
|
111
|
+
return handleError(function (arg0, arg1) {
|
|
112
|
+
const ret = Reflect.get(arg0, arg1);
|
|
113
|
+
return ret;
|
|
114
|
+
}, arguments);
|
|
115
|
+
},
|
|
116
|
+
__wbg_get_unchecked_6e0ad6d2a41b06f6: function (arg0, arg1) {
|
|
117
|
+
const ret = arg0[arg1 >>> 0];
|
|
118
|
+
return ret;
|
|
119
|
+
},
|
|
120
|
+
__wbg_get_with_ref_key_6412cf3094599694: function (arg0, arg1) {
|
|
121
|
+
const ret = arg0[arg1];
|
|
122
|
+
return ret;
|
|
123
|
+
},
|
|
124
|
+
__wbg_instanceof_ArrayBuffer_4480b9e0068a8adb: function (arg0) {
|
|
125
|
+
let result;
|
|
126
|
+
try {
|
|
127
|
+
result = arg0 instanceof ArrayBuffer;
|
|
128
|
+
}
|
|
129
|
+
catch (_) {
|
|
130
|
+
result = false;
|
|
131
|
+
}
|
|
132
|
+
const ret = result;
|
|
133
|
+
return ret;
|
|
134
|
+
},
|
|
135
|
+
__wbg_instanceof_Uint8Array_309b927aaf7a3fc7: function (arg0) {
|
|
136
|
+
let result;
|
|
137
|
+
try {
|
|
138
|
+
result = arg0 instanceof Uint8Array;
|
|
139
|
+
}
|
|
140
|
+
catch (_) {
|
|
141
|
+
result = false;
|
|
142
|
+
}
|
|
143
|
+
const ret = result;
|
|
144
|
+
return ret;
|
|
145
|
+
},
|
|
146
|
+
__wbg_isArray_0677c962b281d01a: function (arg0) {
|
|
147
|
+
const ret = Array.isArray(arg0);
|
|
148
|
+
return ret;
|
|
149
|
+
},
|
|
150
|
+
__wbg_isSafeInteger_04f36e4056f1b851: function (arg0) {
|
|
151
|
+
const ret = Number.isSafeInteger(arg0);
|
|
152
|
+
return ret;
|
|
153
|
+
},
|
|
154
|
+
__wbg_iterator_6f722e4a93058b71: function () {
|
|
155
|
+
const ret = Symbol.iterator;
|
|
156
|
+
return ret;
|
|
157
|
+
},
|
|
158
|
+
__wbg_length_1f0964f4a5e2c6d8: function (arg0) {
|
|
159
|
+
const ret = arg0.length;
|
|
160
|
+
return ret;
|
|
161
|
+
},
|
|
162
|
+
__wbg_length_370319915dc99107: function (arg0) {
|
|
163
|
+
const ret = arg0.length;
|
|
164
|
+
return ret;
|
|
165
|
+
},
|
|
166
|
+
__wbg_new_cd45aabdf6073e84: function (arg0) {
|
|
167
|
+
const ret = new Uint8Array(arg0);
|
|
168
|
+
return ret;
|
|
169
|
+
},
|
|
170
|
+
__wbg_new_da52cf8fe3429cb2: function () {
|
|
171
|
+
const ret = new Object();
|
|
172
|
+
return ret;
|
|
173
|
+
},
|
|
174
|
+
__wbg_next_6dbf2c0ac8cde20f: function (arg0) {
|
|
175
|
+
const ret = arg0.next;
|
|
176
|
+
return ret;
|
|
177
|
+
},
|
|
178
|
+
__wbg_next_71f2aa1cb3d1e37e: function () {
|
|
179
|
+
return handleError(function (arg0) {
|
|
180
|
+
const ret = arg0.next();
|
|
181
|
+
return ret;
|
|
182
|
+
}, arguments);
|
|
183
|
+
},
|
|
184
|
+
__wbg_prototypesetcall_4770620bbe4688a0: function (arg0, arg1, arg2) {
|
|
185
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
186
|
+
},
|
|
187
|
+
__wbg_set_6be42768c690e380: function (arg0, arg1, arg2) {
|
|
188
|
+
arg0[arg1] = arg2;
|
|
189
|
+
},
|
|
190
|
+
__wbg_value_a5d5488a9589444a: function (arg0) {
|
|
191
|
+
const ret = arg0.value;
|
|
192
|
+
return ret;
|
|
193
|
+
},
|
|
194
|
+
__wbindgen_cast_0000000000000001: function (arg0) {
|
|
195
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
196
|
+
const ret = arg0;
|
|
197
|
+
return ret;
|
|
198
|
+
},
|
|
199
|
+
__wbindgen_cast_0000000000000002: function (arg0) {
|
|
200
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
201
|
+
const ret = arg0;
|
|
202
|
+
return ret;
|
|
203
|
+
},
|
|
204
|
+
__wbindgen_cast_0000000000000003: function (arg0, arg1) {
|
|
205
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
206
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
207
|
+
return ret;
|
|
208
|
+
},
|
|
209
|
+
__wbindgen_cast_0000000000000004: function (arg0, arg1) {
|
|
210
|
+
// Cast intrinsic for `U128 -> Externref`.
|
|
211
|
+
const ret = (BigInt.asUintN(64, arg0) | (BigInt.asUintN(64, arg1) << BigInt(64)));
|
|
212
|
+
return ret;
|
|
213
|
+
},
|
|
214
|
+
__wbindgen_cast_0000000000000005: function (arg0) {
|
|
215
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
216
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
217
|
+
return ret;
|
|
218
|
+
},
|
|
219
|
+
__wbindgen_init_externref_table: function () {
|
|
220
|
+
const table = wasm.__wbindgen_externrefs;
|
|
221
|
+
const offset = table.grow(4);
|
|
222
|
+
table.set(0, undefined);
|
|
223
|
+
table.set(offset + 0, undefined);
|
|
224
|
+
table.set(offset + 1, null);
|
|
225
|
+
table.set(offset + 2, true);
|
|
226
|
+
table.set(offset + 3, false);
|
|
227
|
+
},
|
|
228
|
+
};
|
|
229
|
+
return {
|
|
230
|
+
__proto__: null,
|
|
231
|
+
"./picon_dlmm_quote_bg.js": import0,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function addToExternrefTable0(obj) {
|
|
235
|
+
const idx = wasm.__externref_table_alloc();
|
|
236
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
237
|
+
return idx;
|
|
238
|
+
}
|
|
239
|
+
function debugString(val) {
|
|
240
|
+
// primitive types
|
|
241
|
+
const type = typeof val;
|
|
242
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
243
|
+
return `${val}`;
|
|
244
|
+
}
|
|
245
|
+
if (type == 'string') {
|
|
246
|
+
return `"${val}"`;
|
|
247
|
+
}
|
|
248
|
+
if (type == 'symbol') {
|
|
249
|
+
const description = val.description;
|
|
250
|
+
if (description == null) {
|
|
251
|
+
return 'Symbol';
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
return `Symbol(${description})`;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
if (type == 'function') {
|
|
258
|
+
const name = val.name;
|
|
259
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
260
|
+
return `Function(${name})`;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
return 'Function';
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// objects
|
|
267
|
+
if (Array.isArray(val)) {
|
|
268
|
+
const length = val.length;
|
|
269
|
+
let debug = '[';
|
|
270
|
+
if (length > 0) {
|
|
271
|
+
debug += debugString(val[0]);
|
|
272
|
+
}
|
|
273
|
+
for (let i = 1; i < length; i++) {
|
|
274
|
+
debug += ', ' + debugString(val[i]);
|
|
275
|
+
}
|
|
276
|
+
debug += ']';
|
|
277
|
+
return debug;
|
|
278
|
+
}
|
|
279
|
+
// Test for built-in
|
|
280
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
281
|
+
let className;
|
|
282
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
283
|
+
className = builtInMatches[1];
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
// Failed to match the standard '[object ClassName]'
|
|
287
|
+
return toString.call(val);
|
|
288
|
+
}
|
|
289
|
+
if (className == 'Object') {
|
|
290
|
+
// we're a user defined class or Object
|
|
291
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
292
|
+
// easier than looping through ownProperties of `val`.
|
|
293
|
+
try {
|
|
294
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
295
|
+
}
|
|
296
|
+
catch (_) {
|
|
297
|
+
return 'Object';
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
// errors
|
|
301
|
+
if (val instanceof Error) {
|
|
302
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
303
|
+
}
|
|
304
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
305
|
+
return className;
|
|
306
|
+
}
|
|
307
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
308
|
+
ptr = ptr >>> 0;
|
|
309
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
310
|
+
}
|
|
311
|
+
let cachedDataViewMemory0 = null;
|
|
312
|
+
function getDataViewMemory0() {
|
|
313
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
314
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
315
|
+
}
|
|
316
|
+
return cachedDataViewMemory0;
|
|
317
|
+
}
|
|
318
|
+
function getStringFromWasm0(ptr, len) {
|
|
319
|
+
return decodeText(ptr >>> 0, len);
|
|
320
|
+
}
|
|
321
|
+
let cachedUint8ArrayMemory0 = null;
|
|
322
|
+
function getUint8ArrayMemory0() {
|
|
323
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
324
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
325
|
+
}
|
|
326
|
+
return cachedUint8ArrayMemory0;
|
|
327
|
+
}
|
|
328
|
+
function handleError(f, args) {
|
|
329
|
+
try {
|
|
330
|
+
return f.apply(this, args);
|
|
331
|
+
}
|
|
332
|
+
catch (e) {
|
|
333
|
+
const idx = addToExternrefTable0(e);
|
|
334
|
+
wasm.__wbindgen_exn_store(idx);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function isLikeNone(x) {
|
|
338
|
+
return x === undefined || x === null;
|
|
339
|
+
}
|
|
340
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
341
|
+
if (realloc === undefined) {
|
|
342
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
343
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
344
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
345
|
+
WASM_VECTOR_LEN = buf.length;
|
|
346
|
+
return ptr;
|
|
347
|
+
}
|
|
348
|
+
let len = arg.length;
|
|
349
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
350
|
+
const mem = getUint8ArrayMemory0();
|
|
351
|
+
let offset = 0;
|
|
352
|
+
for (; offset < len; offset++) {
|
|
353
|
+
const code = arg.charCodeAt(offset);
|
|
354
|
+
if (code > 0x7F)
|
|
355
|
+
break;
|
|
356
|
+
mem[ptr + offset] = code;
|
|
357
|
+
}
|
|
358
|
+
if (offset !== len) {
|
|
359
|
+
if (offset !== 0) {
|
|
360
|
+
arg = arg.slice(offset);
|
|
361
|
+
}
|
|
362
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
363
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
364
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
365
|
+
offset += ret.written;
|
|
366
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
367
|
+
}
|
|
368
|
+
WASM_VECTOR_LEN = offset;
|
|
369
|
+
return ptr;
|
|
370
|
+
}
|
|
371
|
+
function takeFromExternrefTable0(idx) {
|
|
372
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
373
|
+
wasm.__externref_table_dealloc(idx);
|
|
374
|
+
return value;
|
|
375
|
+
}
|
|
376
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
377
|
+
cachedTextDecoder.decode();
|
|
378
|
+
function decodeText(ptr, len) {
|
|
379
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
380
|
+
}
|
|
381
|
+
const cachedTextEncoder = new TextEncoder();
|
|
382
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
383
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
384
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
385
|
+
view.set(buf);
|
|
386
|
+
return {
|
|
387
|
+
read: arg.length,
|
|
388
|
+
written: buf.length
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
let WASM_VECTOR_LEN = 0;
|
|
393
|
+
const wasmUrl = new URL('picon_dlmm_quote_bg.wasm', import.meta.url);
|
|
394
|
+
const wasmBytes = readFileSync(wasmUrl);
|
|
395
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
396
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
397
|
+
let wasm = wasmInstance.exports;
|
|
398
|
+
wasm.__wbindgen_start();
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm-node-loader.d.ts","sourceRoot":"","sources":["../../src/quote/wasm-node-loader.ts"],"names":[],"mappings":"AAAA,mBAAmB,iCAAiC,CAAC;AACrD,MAAM,MAAM,YAAY,GAAG,cAAc,iCAAiC,CAAC,CAAC;AAM5E,wBAAsB,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC,CAGtD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
let wasmPromise;
|
|
2
|
+
// The `nodejs`-target build self-initializes on `require`/import — nothing to await — but the
|
|
3
|
+
// import itself stays deferred until first call, not tied to when this loader gets imported.
|
|
4
|
+
export async function loadWasm() {
|
|
5
|
+
wasmPromise ??= import("./wasm-node/picon_dlmm_quote.js");
|
|
6
|
+
return await wasmPromise;
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {QuoteInput} input
|
|
3
|
+
* @returns {QuoteOutput}
|
|
4
|
+
*/
|
|
5
|
+
export declare function quote(input: QuoteInput): QuoteOutput;
|
|
6
|
+
declare function initSync(module: any): any;
|
|
7
|
+
declare function __wbg_init(module_or_path: any): Promise<any>;
|
|
8
|
+
export { initSync, __wbg_init as default };
|
|
9
|
+
//# sourceMappingURL=picon_dlmm_quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picon_dlmm_quote.d.ts","sourceRoot":"","sources":["../../../src/quote/wasm-web/picon_dlmm_quote.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAHhB,UAGgB,GAFd,WAAW,CAQvB;AAybD,iBAAS,QAAQ,CAAC,MAAM,KAAA,OAkBvB;AAED,iBAAe,UAAU,CAAC,cAAc,KAAA,gBAwBvC;AAED,OAAO,EAAE,QAAQ,EAAE,UAAU,IAAI,OAAO,EAAE,CAAC"}
|