@nadohq/shared 0.1.0-alpha.4
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/README.md +2 -0
- package/dist/abis/Clearinghouse.cjs +891 -0
- package/dist/abis/Clearinghouse.cjs.map +1 -0
- package/dist/abis/Clearinghouse.d.cts +669 -0
- package/dist/abis/Clearinghouse.d.ts +669 -0
- package/dist/abis/Clearinghouse.js +868 -0
- package/dist/abis/Clearinghouse.js.map +1 -0
- package/dist/abis/ERC20.cjs +215 -0
- package/dist/abis/ERC20.cjs.map +1 -0
- package/dist/abis/ERC20.d.cts +143 -0
- package/dist/abis/ERC20.d.ts +143 -0
- package/dist/abis/ERC20.js +192 -0
- package/dist/abis/ERC20.js.map +1 -0
- package/dist/abis/Endpoint.cjs +589 -0
- package/dist/abis/Endpoint.cjs.map +1 -0
- package/dist/abis/Endpoint.d.cts +433 -0
- package/dist/abis/Endpoint.d.ts +433 -0
- package/dist/abis/Endpoint.js +566 -0
- package/dist/abis/Endpoint.js.map +1 -0
- package/dist/abis/MockERC20.cjs +341 -0
- package/dist/abis/MockERC20.cjs.map +1 -0
- package/dist/abis/MockERC20.d.cts +239 -0
- package/dist/abis/MockERC20.d.ts +239 -0
- package/dist/abis/MockERC20.js +318 -0
- package/dist/abis/MockERC20.js.map +1 -0
- package/dist/abis/PerpEngine.cjs +886 -0
- package/dist/abis/PerpEngine.cjs.map +1 -0
- package/dist/abis/PerpEngine.d.cts +661 -0
- package/dist/abis/PerpEngine.d.ts +661 -0
- package/dist/abis/PerpEngine.js +863 -0
- package/dist/abis/PerpEngine.js.map +1 -0
- package/dist/abis/Querier.cjs +1522 -0
- package/dist/abis/Querier.cjs.map +1 -0
- package/dist/abis/Querier.d.cts +1149 -0
- package/dist/abis/Querier.d.ts +1149 -0
- package/dist/abis/Querier.js +1499 -0
- package/dist/abis/Querier.js.map +1 -0
- package/dist/abis/SpotEngine.cjs +937 -0
- package/dist/abis/SpotEngine.cjs.map +1 -0
- package/dist/abis/SpotEngine.d.cts +701 -0
- package/dist/abis/SpotEngine.d.ts +701 -0
- package/dist/abis/SpotEngine.js +914 -0
- package/dist/abis/SpotEngine.js.map +1 -0
- package/dist/abis/WithdrawPool.cjs +307 -0
- package/dist/abis/WithdrawPool.cjs.map +1 -0
- package/dist/abis/WithdrawPool.d.cts +214 -0
- package/dist/abis/WithdrawPool.d.ts +214 -0
- package/dist/abis/WithdrawPool.js +284 -0
- package/dist/abis/WithdrawPool.js.map +1 -0
- package/dist/abis/index.cjs +41 -0
- package/dist/abis/index.cjs.map +1 -0
- package/dist/abis/index.d.cts +9 -0
- package/dist/abis/index.d.ts +9 -0
- package/dist/abis/index.js +11 -0
- package/dist/abis/index.js.map +1 -0
- package/dist/abis/nadoAbis.cjs +44 -0
- package/dist/abis/nadoAbis.cjs.map +1 -0
- package/dist/abis/nadoAbis.d.cts +3821 -0
- package/dist/abis/nadoAbis.d.ts +3821 -0
- package/dist/abis/nadoAbis.js +21 -0
- package/dist/abis/nadoAbis.js.map +1 -0
- package/dist/chunk-5WRI5ZAA.js +31 -0
- package/dist/chunk-5WRI5ZAA.js.map +1 -0
- package/dist/chunk-TUJ4HQKF.js +33 -0
- package/dist/chunk-TUJ4HQKF.js.map +1 -0
- package/dist/consts/chainEnvToChain.cjs +44 -0
- package/dist/consts/chainEnvToChain.cjs.map +1 -0
- package/dist/consts/chainEnvToChain.d.cts +388 -0
- package/dist/consts/chainEnvToChain.d.ts +388 -0
- package/dist/consts/chainEnvToChain.js +20 -0
- package/dist/consts/chainEnvToChain.js.map +1 -0
- package/dist/consts/index.cjs +27 -0
- package/dist/consts/index.cjs.map +1 -0
- package/dist/consts/index.d.cts +6 -0
- package/dist/consts/index.d.ts +6 -0
- package/dist/consts/index.js +4 -0
- package/dist/consts/index.js.map +1 -0
- package/dist/consts/productIds.cjs +34 -0
- package/dist/consts/productIds.cjs.map +1 -0
- package/dist/consts/productIds.d.cts +4 -0
- package/dist/consts/productIds.d.ts +4 -0
- package/dist/consts/productIds.js +10 -0
- package/dist/consts/productIds.js.map +1 -0
- package/dist/deployments/core/deployment.InkSepolia.json +13 -0
- package/dist/deployments/core/deployment.arbitrumOne.json +18 -0
- package/dist/deployments/core/deployment.localhost.json +18 -0
- package/dist/deployments/index.cjs +65 -0
- package/dist/deployments/index.cjs.map +1 -0
- package/dist/deployments/index.d.cts +13 -0
- package/dist/deployments/index.d.ts +13 -0
- package/dist/deployments/index.js +32 -0
- package/dist/deployments/index.js.map +1 -0
- package/dist/eip712/eip712ValueTypes.cjs +19 -0
- package/dist/eip712/eip712ValueTypes.cjs.map +1 -0
- package/dist/eip712/eip712ValueTypes.d.cts +48 -0
- package/dist/eip712/eip712ValueTypes.d.ts +48 -0
- package/dist/eip712/eip712ValueTypes.js +1 -0
- package/dist/eip712/eip712ValueTypes.js.map +1 -0
- package/dist/eip712/getNadoEIP712Domain.cjs +39 -0
- package/dist/eip712/getNadoEIP712Domain.cjs.map +1 -0
- package/dist/eip712/getNadoEIP712Domain.d.cts +11 -0
- package/dist/eip712/getNadoEIP712Domain.d.ts +11 -0
- package/dist/eip712/getNadoEIP712Domain.js +16 -0
- package/dist/eip712/getNadoEIP712Domain.js.map +1 -0
- package/dist/eip712/getNadoEIP712PrimaryType.cjs +35 -0
- package/dist/eip712/getNadoEIP712PrimaryType.cjs.map +1 -0
- package/dist/eip712/getNadoEIP712PrimaryType.d.cts +16 -0
- package/dist/eip712/getNadoEIP712PrimaryType.d.ts +16 -0
- package/dist/eip712/getNadoEIP712PrimaryType.js +12 -0
- package/dist/eip712/getNadoEIP712PrimaryType.js.map +1 -0
- package/dist/eip712/getNadoEIP712Types.cjs +129 -0
- package/dist/eip712/getNadoEIP712Types.cjs.map +1 -0
- package/dist/eip712/getNadoEIP712Types.d.cts +20 -0
- package/dist/eip712/getNadoEIP712Types.d.ts +20 -0
- package/dist/eip712/getNadoEIP712Types.js +106 -0
- package/dist/eip712/getNadoEIP712Types.js.map +1 -0
- package/dist/eip712/getNadoEIP712Values.cjs +206 -0
- package/dist/eip712/getNadoEIP712Values.cjs.map +1 -0
- package/dist/eip712/getNadoEIP712Values.d.cts +20 -0
- package/dist/eip712/getNadoEIP712Values.d.ts +20 -0
- package/dist/eip712/getNadoEIP712Values.js +183 -0
- package/dist/eip712/getNadoEIP712Values.js.map +1 -0
- package/dist/eip712/getOrderVerifyingAddress.cjs +34 -0
- package/dist/eip712/getOrderVerifyingAddress.cjs.map +1 -0
- package/dist/eip712/getOrderVerifyingAddress.d.cts +9 -0
- package/dist/eip712/getOrderVerifyingAddress.d.ts +9 -0
- package/dist/eip712/getOrderVerifyingAddress.js +11 -0
- package/dist/eip712/getOrderVerifyingAddress.js.map +1 -0
- package/dist/eip712/getSignedTransactionRequest.cjs +42 -0
- package/dist/eip712/getSignedTransactionRequest.cjs.map +1 -0
- package/dist/eip712/getSignedTransactionRequest.d.cts +19 -0
- package/dist/eip712/getSignedTransactionRequest.d.ts +19 -0
- package/dist/eip712/getSignedTransactionRequest.js +19 -0
- package/dist/eip712/getSignedTransactionRequest.js.map +1 -0
- package/dist/eip712/index.cjs +43 -0
- package/dist/eip712/index.cjs.map +1 -0
- package/dist/eip712/index.d.cts +17 -0
- package/dist/eip712/index.d.ts +17 -0
- package/dist/eip712/index.js +12 -0
- package/dist/eip712/index.js.map +1 -0
- package/dist/eip712/orderDigest.cjs +45 -0
- package/dist/eip712/orderDigest.cjs.map +1 -0
- package/dist/eip712/orderDigest.d.cts +20 -0
- package/dist/eip712/orderDigest.d.ts +20 -0
- package/dist/eip712/orderDigest.js +22 -0
- package/dist/eip712/orderDigest.js.map +1 -0
- package/dist/eip712/signableRequestType.cjs +19 -0
- package/dist/eip712/signableRequestType.cjs.map +1 -0
- package/dist/eip712/signableRequestType.d.cts +26 -0
- package/dist/eip712/signableRequestType.d.ts +26 -0
- package/dist/eip712/signableRequestType.js +1 -0
- package/dist/eip712/signableRequestType.js.map +1 -0
- package/dist/eip712/signatureParamTypes.cjs +19 -0
- package/dist/eip712/signatureParamTypes.cjs.map +1 -0
- package/dist/eip712/signatureParamTypes.d.cts +68 -0
- package/dist/eip712/signatureParamTypes.d.ts +68 -0
- package/dist/eip712/signatureParamTypes.js +1 -0
- package/dist/eip712/signatureParamTypes.js.map +1 -0
- package/dist/encoding/encoding.cjs +73 -0
- package/dist/encoding/encoding.cjs.map +1 -0
- package/dist/encoding/encoding.d.cts +11 -0
- package/dist/encoding/encoding.d.ts +11 -0
- package/dist/encoding/encoding.js +49 -0
- package/dist/encoding/encoding.js.map +1 -0
- package/dist/encoding/index.cjs +25 -0
- package/dist/encoding/index.cjs.map +1 -0
- package/dist/encoding/index.d.cts +7 -0
- package/dist/encoding/index.d.ts +7 -0
- package/dist/encoding/index.js +3 -0
- package/dist/encoding/index.js.map +1 -0
- package/dist/execute/approveDepositAllowance.cjs +38 -0
- package/dist/execute/approveDepositAllowance.cjs.map +1 -0
- package/dist/execute/approveDepositAllowance.d.cts +18 -0
- package/dist/execute/approveDepositAllowance.d.ts +18 -0
- package/dist/execute/approveDepositAllowance.js +15 -0
- package/dist/execute/approveDepositAllowance.js.map +1 -0
- package/dist/execute/depositCollateral.cjs +59 -0
- package/dist/execute/depositCollateral.cjs.map +1 -0
- package/dist/execute/depositCollateral.d.cts +21 -0
- package/dist/execute/depositCollateral.d.ts +21 -0
- package/dist/execute/depositCollateral.js +36 -0
- package/dist/execute/depositCollateral.js.map +1 -0
- package/dist/execute/index.cjs +27 -0
- package/dist/execute/index.cjs.map +1 -0
- package/dist/execute/index.d.cts +9 -0
- package/dist/execute/index.d.ts +9 -0
- package/dist/execute/index.js +4 -0
- package/dist/execute/index.js.map +1 -0
- package/dist/index.cjs +39 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +67 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/types/ChainEnv.cjs +44 -0
- package/dist/types/ChainEnv.cjs.map +1 -0
- package/dist/types/ChainEnv.d.cts +7 -0
- package/dist/types/ChainEnv.d.ts +7 -0
- package/dist/types/ChainEnv.js +18 -0
- package/dist/types/ChainEnv.js.map +1 -0
- package/dist/types/OrderExecutionType.cjs +19 -0
- package/dist/types/OrderExecutionType.cjs.map +1 -0
- package/dist/types/OrderExecutionType.d.cts +10 -0
- package/dist/types/OrderExecutionType.d.ts +10 -0
- package/dist/types/OrderExecutionType.js +1 -0
- package/dist/types/OrderExecutionType.js.map +1 -0
- package/dist/types/balanceTypes.cjs +19 -0
- package/dist/types/balanceTypes.cjs.map +1 -0
- package/dist/types/balanceTypes.d.cts +38 -0
- package/dist/types/balanceTypes.d.ts +38 -0
- package/dist/types/balanceTypes.js +1 -0
- package/dist/types/balanceTypes.js.map +1 -0
- package/dist/types/bytes.cjs +19 -0
- package/dist/types/bytes.cjs.map +1 -0
- package/dist/types/bytes.d.cts +3 -0
- package/dist/types/bytes.d.ts +3 -0
- package/dist/types/bytes.js +1 -0
- package/dist/types/bytes.js.map +1 -0
- package/dist/types/healthTypes.cjs +19 -0
- package/dist/types/healthTypes.cjs.map +1 -0
- package/dist/types/healthTypes.d.cts +15 -0
- package/dist/types/healthTypes.d.ts +15 -0
- package/dist/types/healthTypes.js +1 -0
- package/dist/types/healthTypes.js.map +1 -0
- package/dist/types/index.cjs +45 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +15 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.js +13 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/marketTypes.cjs +19 -0
- package/dist/types/marketTypes.cjs.map +1 -0
- package/dist/types/marketTypes.d.cts +31 -0
- package/dist/types/marketTypes.d.ts +31 -0
- package/dist/types/marketTypes.js +1 -0
- package/dist/types/marketTypes.js.map +1 -0
- package/dist/types/nadoContractTypes.cjs +19 -0
- package/dist/types/nadoContractTypes.cjs.map +1 -0
- package/dist/types/nadoContractTypes.d.cts +14 -0
- package/dist/types/nadoContractTypes.d.ts +14 -0
- package/dist/types/nadoContractTypes.js +1 -0
- package/dist/types/nadoContractTypes.js.map +1 -0
- package/dist/types/orderAppendixTypes.cjs +19 -0
- package/dist/types/orderAppendixTypes.cjs.map +1 -0
- package/dist/types/orderAppendixTypes.d.cts +54 -0
- package/dist/types/orderAppendixTypes.d.ts +54 -0
- package/dist/types/orderAppendixTypes.js +1 -0
- package/dist/types/orderAppendixTypes.js.map +1 -0
- package/dist/types/productTypes.cjs +47 -0
- package/dist/types/productTypes.cjs.map +1 -0
- package/dist/types/productTypes.d.cts +55 -0
- package/dist/types/productTypes.d.ts +55 -0
- package/dist/types/productTypes.js +23 -0
- package/dist/types/productTypes.js.map +1 -0
- package/dist/types/subaccountTypes.cjs +19 -0
- package/dist/types/subaccountTypes.cjs.map +1 -0
- package/dist/types/subaccountTypes.d.cts +13 -0
- package/dist/types/subaccountTypes.d.ts +13 -0
- package/dist/types/subaccountTypes.js +1 -0
- package/dist/types/subaccountTypes.js.map +1 -0
- package/dist/types/viemTypes.cjs +19 -0
- package/dist/types/viemTypes.cjs.map +1 -0
- package/dist/types/viemTypes.d.cts +23 -0
- package/dist/types/viemTypes.d.ts +23 -0
- package/dist/types/viemTypes.js +1 -0
- package/dist/types/viemTypes.js.map +1 -0
- package/dist/utils/asyncResult.cjs +36 -0
- package/dist/utils/asyncResult.cjs.map +1 -0
- package/dist/utils/asyncResult.d.cts +4 -0
- package/dist/utils/asyncResult.d.ts +4 -0
- package/dist/utils/asyncResult.js +13 -0
- package/dist/utils/asyncResult.js.map +1 -0
- package/dist/utils/balanceValue.cjs +43 -0
- package/dist/utils/balanceValue.cjs.map +1 -0
- package/dist/utils/balanceValue.d.cts +25 -0
- package/dist/utils/balanceValue.d.ts +25 -0
- package/dist/utils/balanceValue.js +18 -0
- package/dist/utils/balanceValue.js.map +1 -0
- package/dist/utils/bytes32.cjs +92 -0
- package/dist/utils/bytes32.cjs.map +1 -0
- package/dist/utils/bytes32.d.cts +47 -0
- package/dist/utils/bytes32.d.ts +47 -0
- package/dist/utils/bytes32.js +64 -0
- package/dist/utils/bytes32.js.map +1 -0
- package/dist/utils/bytes32.test.cjs +203 -0
- package/dist/utils/bytes32.test.cjs.map +1 -0
- package/dist/utils/bytes32.test.d.cts +2 -0
- package/dist/utils/bytes32.test.d.ts +2 -0
- package/dist/utils/bytes32.test.js +165 -0
- package/dist/utils/bytes32.test.js.map +1 -0
- package/dist/utils/createDeterministicLinkedSignerPrivateKey.cjs +56 -0
- package/dist/utils/createDeterministicLinkedSignerPrivateKey.cjs.map +1 -0
- package/dist/utils/createDeterministicLinkedSignerPrivateKey.d.cts +20 -0
- package/dist/utils/createDeterministicLinkedSignerPrivateKey.d.ts +20 -0
- package/dist/utils/createDeterministicLinkedSignerPrivateKey.js +33 -0
- package/dist/utils/createDeterministicLinkedSignerPrivateKey.js.map +1 -0
- package/dist/utils/errors/WalletNotProvidedError.cjs +36 -0
- package/dist/utils/errors/WalletNotProvidedError.cjs.map +1 -0
- package/dist/utils/errors/WalletNotProvidedError.d.cts +5 -0
- package/dist/utils/errors/WalletNotProvidedError.d.ts +5 -0
- package/dist/utils/errors/WalletNotProvidedError.js +13 -0
- package/dist/utils/errors/WalletNotProvidedError.js.map +1 -0
- package/dist/utils/errors/index.cjs +25 -0
- package/dist/utils/errors/index.cjs.map +1 -0
- package/dist/utils/errors/index.d.cts +1 -0
- package/dist/utils/errors/index.d.ts +1 -0
- package/dist/utils/errors/index.js +3 -0
- package/dist/utils/errors/index.js.map +1 -0
- package/dist/utils/getValidatedAddress.cjs +37 -0
- package/dist/utils/getValidatedAddress.cjs.map +1 -0
- package/dist/utils/getValidatedAddress.d.cts +9 -0
- package/dist/utils/getValidatedAddress.d.ts +9 -0
- package/dist/utils/getValidatedAddress.js +14 -0
- package/dist/utils/getValidatedAddress.js.map +1 -0
- package/dist/utils/getValidatedHex.cjs +37 -0
- package/dist/utils/getValidatedHex.cjs.map +1 -0
- package/dist/utils/getValidatedHex.d.cts +9 -0
- package/dist/utils/getValidatedHex.d.ts +9 -0
- package/dist/utils/getValidatedHex.js +14 -0
- package/dist/utils/getValidatedHex.js.map +1 -0
- package/dist/utils/index.cjs +53 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +37 -0
- package/dist/utils/index.d.ts +37 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/interest.cjs +94 -0
- package/dist/utils/interest.cjs.map +1 -0
- package/dist/utils/interest.d.cts +50 -0
- package/dist/utils/interest.d.ts +50 -0
- package/dist/utils/interest.js +70 -0
- package/dist/utils/interest.js.map +1 -0
- package/dist/utils/isWriteableContract.cjs +33 -0
- package/dist/utils/isWriteableContract.cjs.map +1 -0
- package/dist/utils/isWriteableContract.d.cts +6 -0
- package/dist/utils/isWriteableContract.d.ts +6 -0
- package/dist/utils/isWriteableContract.js +10 -0
- package/dist/utils/isWriteableContract.js.map +1 -0
- package/dist/utils/mapValues.cjs +38 -0
- package/dist/utils/mapValues.cjs.map +1 -0
- package/dist/utils/mapValues.d.cts +6 -0
- package/dist/utils/mapValues.d.ts +6 -0
- package/dist/utils/mapValues.js +15 -0
- package/dist/utils/mapValues.js.map +1 -0
- package/dist/utils/math/BigDecimals.cjs +37 -0
- package/dist/utils/math/BigDecimals.cjs.map +1 -0
- package/dist/utils/math/BigDecimals.d.cts +8 -0
- package/dist/utils/math/BigDecimals.d.ts +8 -0
- package/dist/utils/math/BigDecimals.js +14 -0
- package/dist/utils/math/BigDecimals.js.map +1 -0
- package/dist/utils/math/bigDecimal.cjs +57 -0
- package/dist/utils/math/bigDecimal.cjs.map +1 -0
- package/dist/utils/math/bigDecimal.d.cts +18 -0
- package/dist/utils/math/bigDecimal.d.ts +18 -0
- package/dist/utils/math/bigDecimal.js +23 -0
- package/dist/utils/math/bigDecimal.js.map +1 -0
- package/dist/utils/math/clamp.cjs +38 -0
- package/dist/utils/math/clamp.cjs.map +1 -0
- package/dist/utils/math/clamp.d.cts +15 -0
- package/dist/utils/math/clamp.d.ts +15 -0
- package/dist/utils/math/clamp.js +15 -0
- package/dist/utils/math/clamp.js.map +1 -0
- package/dist/utils/math/decimalAdjustment.cjs +60 -0
- package/dist/utils/math/decimalAdjustment.cjs.map +1 -0
- package/dist/utils/math/decimalAdjustment.d.cts +31 -0
- package/dist/utils/math/decimalAdjustment.d.ts +31 -0
- package/dist/utils/math/decimalAdjustment.js +35 -0
- package/dist/utils/math/decimalAdjustment.js.map +1 -0
- package/dist/utils/math/index.cjs +37 -0
- package/dist/utils/math/index.cjs.map +1 -0
- package/dist/utils/math/index.d.cts +8 -0
- package/dist/utils/math/index.d.ts +8 -0
- package/dist/utils/math/index.js +9 -0
- package/dist/utils/math/index.js.map +1 -0
- package/dist/utils/math/sumBigDecimalBy.cjs +36 -0
- package/dist/utils/math/sumBigDecimalBy.cjs.map +1 -0
- package/dist/utils/math/sumBigDecimalBy.d.cts +10 -0
- package/dist/utils/math/sumBigDecimalBy.d.ts +10 -0
- package/dist/utils/math/sumBigDecimalBy.js +13 -0
- package/dist/utils/math/sumBigDecimalBy.js.map +1 -0
- package/dist/utils/math/toBigInt.cjs +34 -0
- package/dist/utils/math/toBigInt.cjs.map +1 -0
- package/dist/utils/math/toBigInt.d.cts +11 -0
- package/dist/utils/math/toBigInt.d.ts +11 -0
- package/dist/utils/math/toBigInt.js +11 -0
- package/dist/utils/math/toBigInt.js.map +1 -0
- package/dist/utils/math/toIntegerString.cjs +34 -0
- package/dist/utils/math/toIntegerString.cjs.map +1 -0
- package/dist/utils/math/toIntegerString.d.cts +11 -0
- package/dist/utils/math/toIntegerString.d.ts +11 -0
- package/dist/utils/math/toIntegerString.js +11 -0
- package/dist/utils/math/toIntegerString.js.map +1 -0
- package/dist/utils/orders/appendix/appendixTWAPValue.cjs +50 -0
- package/dist/utils/orders/appendix/appendixTWAPValue.cjs.map +1 -0
- package/dist/utils/orders/appendix/appendixTWAPValue.d.cts +31 -0
- package/dist/utils/orders/appendix/appendixTWAPValue.d.ts +31 -0
- package/dist/utils/orders/appendix/appendixTWAPValue.js +26 -0
- package/dist/utils/orders/appendix/appendixTWAPValue.js.map +1 -0
- package/dist/utils/orders/appendix/bitMaskValue.cjs +34 -0
- package/dist/utils/orders/appendix/bitMaskValue.cjs.map +1 -0
- package/dist/utils/orders/appendix/bitMaskValue.d.cts +10 -0
- package/dist/utils/orders/appendix/bitMaskValue.d.ts +10 -0
- package/dist/utils/orders/appendix/bitMaskValue.js +11 -0
- package/dist/utils/orders/appendix/bitMaskValue.js.map +1 -0
- package/dist/utils/orders/appendix/index.cjs +33 -0
- package/dist/utils/orders/appendix/index.cjs.map +1 -0
- package/dist/utils/orders/appendix/index.d.cts +9 -0
- package/dist/utils/orders/appendix/index.d.ts +9 -0
- package/dist/utils/orders/appendix/index.js +7 -0
- package/dist/utils/orders/appendix/index.js.map +1 -0
- package/dist/utils/orders/appendix/orderAppendix.test.cjs +165 -0
- package/dist/utils/orders/appendix/orderAppendix.test.cjs.map +1 -0
- package/dist/utils/orders/appendix/orderAppendix.test.d.cts +2 -0
- package/dist/utils/orders/appendix/orderAppendix.test.d.ts +2 -0
- package/dist/utils/orders/appendix/orderAppendix.test.js +120 -0
- package/dist/utils/orders/appendix/orderAppendix.test.js.map +1 -0
- package/dist/utils/orders/appendix/packOrderAppendix.cjs +88 -0
- package/dist/utils/orders/appendix/packOrderAppendix.cjs.map +1 -0
- package/dist/utils/orders/appendix/packOrderAppendix.d.cts +12 -0
- package/dist/utils/orders/appendix/packOrderAppendix.d.ts +12 -0
- package/dist/utils/orders/appendix/packOrderAppendix.js +65 -0
- package/dist/utils/orders/appendix/packOrderAppendix.js.map +1 -0
- package/dist/utils/orders/appendix/types.cjs +19 -0
- package/dist/utils/orders/appendix/types.cjs.map +1 -0
- package/dist/utils/orders/appendix/types.d.cts +19 -0
- package/dist/utils/orders/appendix/types.d.ts +19 -0
- package/dist/utils/orders/appendix/types.js +1 -0
- package/dist/utils/orders/appendix/types.js.map +1 -0
- package/dist/utils/orders/appendix/unpackOrderAppendix.cjs +106 -0
- package/dist/utils/orders/appendix/unpackOrderAppendix.cjs.map +1 -0
- package/dist/utils/orders/appendix/unpackOrderAppendix.d.cts +12 -0
- package/dist/utils/orders/appendix/unpackOrderAppendix.d.ts +12 -0
- package/dist/utils/orders/appendix/unpackOrderAppendix.js +83 -0
- package/dist/utils/orders/appendix/unpackOrderAppendix.js.map +1 -0
- package/dist/utils/orders/index.cjs +29 -0
- package/dist/utils/orders/index.cjs.map +1 -0
- package/dist/utils/orders/index.d.cts +11 -0
- package/dist/utils/orders/index.d.ts +11 -0
- package/dist/utils/orders/index.js +5 -0
- package/dist/utils/orders/index.js.map +1 -0
- package/dist/utils/orders/orderNonce.cjs +44 -0
- package/dist/utils/orders/orderNonce.cjs.map +1 -0
- package/dist/utils/orders/orderNonce.d.cts +14 -0
- package/dist/utils/orders/orderNonce.d.ts +14 -0
- package/dist/utils/orders/orderNonce.js +20 -0
- package/dist/utils/orders/orderNonce.js.map +1 -0
- package/dist/utils/orders/recvTime.cjs +33 -0
- package/dist/utils/orders/recvTime.cjs.map +1 -0
- package/dist/utils/orders/recvTime.d.cts +9 -0
- package/dist/utils/orders/recvTime.d.ts +9 -0
- package/dist/utils/orders/recvTime.js +10 -0
- package/dist/utils/orders/recvTime.js.map +1 -0
- package/dist/utils/productTypeFilter.cjs +49 -0
- package/dist/utils/productTypeFilter.cjs.map +1 -0
- package/dist/utils/productTypeFilter.d.cts +11 -0
- package/dist/utils/productTypeFilter.d.ts +11 -0
- package/dist/utils/productTypeFilter.js +25 -0
- package/dist/utils/productTypeFilter.js.map +1 -0
- package/dist/utils/time.cjs +47 -0
- package/dist/utils/time.cjs.map +1 -0
- package/dist/utils/time.d.cts +17 -0
- package/dist/utils/time.d.ts +17 -0
- package/dist/utils/time.js +22 -0
- package/dist/utils/time.js.map +1 -0
- package/dist/utils/toPrintableObject.cjs +51 -0
- package/dist/utils/toPrintableObject.cjs.map +1 -0
- package/dist/utils/toPrintableObject.d.cts +6 -0
- package/dist/utils/toPrintableObject.d.ts +6 -0
- package/dist/utils/toPrintableObject.js +28 -0
- package/dist/utils/toPrintableObject.js.map +1 -0
- package/package.json +49 -0
- package/src/abis/Clearinghouse.ts +861 -0
- package/src/abis/ERC20.ts +185 -0
- package/src/abis/Endpoint.ts +559 -0
- package/src/abis/MockERC20.ts +311 -0
- package/src/abis/PerpEngine.ts +856 -0
- package/src/abis/Querier.ts +1492 -0
- package/src/abis/SpotEngine.ts +907 -0
- package/src/abis/WithdrawPool.ts +277 -0
- package/src/abis/index.ts +9 -0
- package/src/abis/nadoAbis.ts +19 -0
- package/src/consts/chainEnvToChain.ts +16 -0
- package/src/consts/index.ts +2 -0
- package/src/consts/productIds.ts +3 -0
- package/src/deployments/core/deployment.InkSepolia.json +13 -0
- package/src/deployments/core/deployment.arbitrumOne.json +18 -0
- package/src/deployments/core/deployment.localhost.json +18 -0
- package/src/deployments/index.ts +40 -0
- package/src/eip712/eip712ValueTypes.ts +83 -0
- package/src/eip712/getNadoEIP712Domain.ts +20 -0
- package/src/eip712/getNadoEIP712PrimaryType.ts +13 -0
- package/src/eip712/getNadoEIP712Types.ts +113 -0
- package/src/eip712/getNadoEIP712Values.ts +248 -0
- package/src/eip712/getOrderVerifyingAddress.ts +9 -0
- package/src/eip712/getSignedTransactionRequest.ts +30 -0
- package/src/eip712/index.ts +10 -0
- package/src/eip712/orderDigest.ts +28 -0
- package/src/eip712/signableRequestType.ts +32 -0
- package/src/eip712/signatureParamTypes.ts +84 -0
- package/src/encoding/encoding.ts +50 -0
- package/src/encoding/index.ts +1 -0
- package/src/execute/approveDepositAllowance.ts +20 -0
- package/src/execute/depositCollateral.ts +43 -0
- package/src/execute/index.ts +2 -0
- package/src/index.ts +8 -0
- package/src/types/ChainEnv.ts +13 -0
- package/src/types/OrderExecutionType.ts +8 -0
- package/src/types/balanceTypes.ts +47 -0
- package/src/types/bytes.ts +1 -0
- package/src/types/healthTypes.ts +17 -0
- package/src/types/index.ts +11 -0
- package/src/types/marketTypes.ts +40 -0
- package/src/types/nadoContractTypes.ts +14 -0
- package/src/types/orderAppendixTypes.ts +58 -0
- package/src/types/productTypes.ts +76 -0
- package/src/types/subaccountTypes.ts +13 -0
- package/src/types/viemTypes.ts +42 -0
- package/src/utils/asyncResult.ts +12 -0
- package/src/utils/balanceValue.ts +42 -0
- package/src/utils/bytes32.test.ts +117 -0
- package/src/utils/bytes32.ts +110 -0
- package/src/utils/createDeterministicLinkedSignerPrivateKey.ts +46 -0
- package/src/utils/errors/WalletNotProvidedError.ts +6 -0
- package/src/utils/errors/index.ts +1 -0
- package/src/utils/getValidatedAddress.ts +13 -0
- package/src/utils/getValidatedHex.ts +13 -0
- package/src/utils/index.ts +15 -0
- package/src/utils/interest.ts +133 -0
- package/src/utils/isWriteableContract.ts +11 -0
- package/src/utils/mapValues.ts +18 -0
- package/src/utils/math/BigDecimals.ts +8 -0
- package/src/utils/math/bigDecimal.ts +32 -0
- package/src/utils/math/clamp.ts +26 -0
- package/src/utils/math/decimalAdjustment.ts +65 -0
- package/src/utils/math/index.ts +7 -0
- package/src/utils/math/sumBigDecimalBy.ts +18 -0
- package/src/utils/math/toBigInt.ts +11 -0
- package/src/utils/math/toIntegerString.ts +11 -0
- package/src/utils/orders/appendix/appendixTWAPValue.ts +51 -0
- package/src/utils/orders/appendix/bitMaskValue.ts +11 -0
- package/src/utils/orders/appendix/index.ts +5 -0
- package/src/utils/orders/appendix/orderAppendix.test.ts +121 -0
- package/src/utils/orders/appendix/packOrderAppendix.ts +71 -0
- package/src/utils/orders/appendix/types.ts +17 -0
- package/src/utils/orders/appendix/unpackOrderAppendix.ts +90 -0
- package/src/utils/orders/index.ts +3 -0
- package/src/utils/orders/orderNonce.ts +32 -0
- package/src/utils/orders/recvTime.ts +9 -0
- package/src/utils/productTypeFilter.ts +23 -0
- package/src/utils/time.ts +21 -0
- package/src/utils/toPrintableObject.ts +25 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/utils/math/index.ts
|
|
18
|
+
var math_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(math_exports);
|
|
20
|
+
__reExport(math_exports, require("./bigDecimal.cjs"), module.exports);
|
|
21
|
+
__reExport(math_exports, require("./toIntegerString.cjs"), module.exports);
|
|
22
|
+
__reExport(math_exports, require("./toBigInt.cjs"), module.exports);
|
|
23
|
+
__reExport(math_exports, require("./clamp.cjs"), module.exports);
|
|
24
|
+
__reExport(math_exports, require("./sumBigDecimalBy.cjs"), module.exports);
|
|
25
|
+
__reExport(math_exports, require("./decimalAdjustment.cjs"), module.exports);
|
|
26
|
+
__reExport(math_exports, require("./BigDecimals.cjs"), module.exports);
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
...require("./bigDecimal.cjs"),
|
|
30
|
+
...require("./toIntegerString.cjs"),
|
|
31
|
+
...require("./toBigInt.cjs"),
|
|
32
|
+
...require("./clamp.cjs"),
|
|
33
|
+
...require("./sumBigDecimalBy.cjs"),
|
|
34
|
+
...require("./decimalAdjustment.cjs"),
|
|
35
|
+
...require("./BigDecimals.cjs")
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/math/index.ts"],"sourcesContent":["export * from './bigDecimal';\nexport * from './toIntegerString';\nexport * from './toBigInt';\nexport * from './clamp';\nexport * from './sumBigDecimalBy';\nexport * from './decimalAdjustment';\nexport * from './BigDecimals';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,yBAAc,6BAAd;AACA,yBAAc,kCADd;AAEA,yBAAc,2BAFd;AAGA,yBAAc,wBAHd;AAIA,yBAAc,kCAJd;AAKA,yBAAc,oCALd;AAMA,yBAAc,8BANd;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { BigDecimalish, toBigDecimal } from './bigDecimal.cjs';
|
|
2
|
+
export { toIntegerString } from './toIntegerString.cjs';
|
|
3
|
+
export { toBigInt } from './toBigInt.cjs';
|
|
4
|
+
export { clampBigDecimal } from './clamp.cjs';
|
|
5
|
+
export { sumBigDecimalBy } from './sumBigDecimalBy.cjs';
|
|
6
|
+
export { NADO_PRODUCT_DECIMALS, addDecimals, removeDecimals } from './decimalAdjustment.cjs';
|
|
7
|
+
export { BigDecimals } from './BigDecimals.cjs';
|
|
8
|
+
export { default as BigDecimal } from 'bignumber.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { BigDecimalish, toBigDecimal } from './bigDecimal.js';
|
|
2
|
+
export { toIntegerString } from './toIntegerString.js';
|
|
3
|
+
export { toBigInt } from './toBigInt.js';
|
|
4
|
+
export { clampBigDecimal } from './clamp.js';
|
|
5
|
+
export { sumBigDecimalBy } from './sumBigDecimalBy.js';
|
|
6
|
+
export { NADO_PRODUCT_DECIMALS, addDecimals, removeDecimals } from './decimalAdjustment.js';
|
|
7
|
+
export { BigDecimals } from './BigDecimals.js';
|
|
8
|
+
export { default as BigDecimal } from 'bignumber.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/utils/math/index.ts
|
|
2
|
+
export * from "./bigDecimal.js";
|
|
3
|
+
export * from "./toIntegerString.js";
|
|
4
|
+
export * from "./toBigInt.js";
|
|
5
|
+
export * from "./clamp.js";
|
|
6
|
+
export * from "./sumBigDecimalBy.js";
|
|
7
|
+
export * from "./decimalAdjustment.js";
|
|
8
|
+
export * from "./BigDecimals.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/math/index.ts"],"sourcesContent":["export * from './bigDecimal';\nexport * from './toIntegerString';\nexport * from './toBigInt';\nexport * from './clamp';\nexport * from './sumBigDecimalBy';\nexport * from './decimalAdjustment';\nexport * from './BigDecimals';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/math/sumBigDecimalBy.ts
|
|
21
|
+
var sumBigDecimalBy_exports = {};
|
|
22
|
+
__export(sumBigDecimalBy_exports, {
|
|
23
|
+
sumBigDecimalBy: () => sumBigDecimalBy
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(sumBigDecimalBy_exports);
|
|
26
|
+
var import_BigDecimals = require("./BigDecimals.cjs");
|
|
27
|
+
function sumBigDecimalBy(collection, iteratee) {
|
|
28
|
+
return collection?.reduce((total, item) => {
|
|
29
|
+
return total.plus(iteratee(item));
|
|
30
|
+
}, import_BigDecimals.BigDecimals.ZERO) ?? import_BigDecimals.BigDecimals.ZERO;
|
|
31
|
+
}
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
sumBigDecimalBy
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=sumBigDecimalBy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/math/sumBigDecimalBy.ts"],"sourcesContent":["import { BigDecimal } from './bigDecimal';\nimport { BigDecimals } from './BigDecimals';\n\n/**\n * Util function to sum BigDecimal values, inspired by Lodash\n * @param collection\n * @param iteratee\n */\nexport function sumBigDecimalBy<T>(\n collection: T[] | null | undefined,\n iteratee: (value: T) => BigDecimal.Value,\n): BigDecimal {\n return (\n collection?.reduce((total, item) => {\n return total.plus(iteratee(item));\n }, BigDecimals.ZERO) ?? BigDecimals.ZERO\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAA4B;AAOrB,SAAS,gBACd,YACA,UACY;AACZ,SACE,YAAY,OAAO,CAAC,OAAO,SAAS;AAClC,WAAO,MAAM,KAAK,SAAS,IAAI,CAAC;AAAA,EAClC,GAAG,+BAAY,IAAI,KAAK,+BAAY;AAExC;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import BigDecimal from 'bignumber.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Util function to sum BigDecimal values, inspired by Lodash
|
|
5
|
+
* @param collection
|
|
6
|
+
* @param iteratee
|
|
7
|
+
*/
|
|
8
|
+
declare function sumBigDecimalBy<T>(collection: T[] | null | undefined, iteratee: (value: T) => BigDecimal.Value): BigDecimal;
|
|
9
|
+
|
|
10
|
+
export { sumBigDecimalBy };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import BigDecimal from 'bignumber.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Util function to sum BigDecimal values, inspired by Lodash
|
|
5
|
+
* @param collection
|
|
6
|
+
* @param iteratee
|
|
7
|
+
*/
|
|
8
|
+
declare function sumBigDecimalBy<T>(collection: T[] | null | undefined, iteratee: (value: T) => BigDecimal.Value): BigDecimal;
|
|
9
|
+
|
|
10
|
+
export { sumBigDecimalBy };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "../../chunk-5WRI5ZAA.js";
|
|
2
|
+
|
|
3
|
+
// src/utils/math/sumBigDecimalBy.ts
|
|
4
|
+
import { BigDecimals } from "./BigDecimals.js";
|
|
5
|
+
function sumBigDecimalBy(collection, iteratee) {
|
|
6
|
+
return collection?.reduce((total, item) => {
|
|
7
|
+
return total.plus(iteratee(item));
|
|
8
|
+
}, BigDecimals.ZERO) ?? BigDecimals.ZERO;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
sumBigDecimalBy
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=sumBigDecimalBy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/math/sumBigDecimalBy.ts"],"sourcesContent":["import { BigDecimal } from './bigDecimal';\nimport { BigDecimals } from './BigDecimals';\n\n/**\n * Util function to sum BigDecimal values, inspired by Lodash\n * @param collection\n * @param iteratee\n */\nexport function sumBigDecimalBy<T>(\n collection: T[] | null | undefined,\n iteratee: (value: T) => BigDecimal.Value,\n): BigDecimal {\n return (\n collection?.reduce((total, item) => {\n return total.plus(iteratee(item));\n }, BigDecimals.ZERO) ?? BigDecimals.ZERO\n );\n}\n"],"mappings":";;;AACA,SAAS,mBAAmB;AAOrB,SAAS,gBACd,YACA,UACY;AACZ,SACE,YAAY,OAAO,CAAC,OAAO,SAAS;AAClC,WAAO,MAAM,KAAK,SAAS,IAAI,CAAC;AAAA,EAClC,GAAG,YAAY,IAAI,KAAK,YAAY;AAExC;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/math/toBigInt.ts
|
|
21
|
+
var toBigInt_exports = {};
|
|
22
|
+
__export(toBigInt_exports, {
|
|
23
|
+
toBigInt: () => toBigInt
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(toBigInt_exports);
|
|
26
|
+
var import_toIntegerString = require("./toIntegerString.cjs");
|
|
27
|
+
function toBigInt(val) {
|
|
28
|
+
return BigInt((0, import_toIntegerString.toIntegerString)(val));
|
|
29
|
+
}
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
toBigInt
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=toBigInt.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/math/toBigInt.ts"],"sourcesContent":["import { BigDecimalish } from './bigDecimal';\nimport { toIntegerString } from './toIntegerString';\n\n/**\n * Converts a BigDecimalish value to bigint\n *\n * @param val\n */\nexport function toBigInt(val: BigDecimalish): bigint {\n return BigInt(toIntegerString(val));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,6BAAgC;AAOzB,SAAS,SAAS,KAA4B;AACnD,SAAO,WAAO,wCAAgB,GAAG,CAAC;AACpC;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../../chunk-5WRI5ZAA.js";
|
|
2
|
+
|
|
3
|
+
// src/utils/math/toBigInt.ts
|
|
4
|
+
import { toIntegerString } from "./toIntegerString.js";
|
|
5
|
+
function toBigInt(val) {
|
|
6
|
+
return BigInt(toIntegerString(val));
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
toBigInt
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=toBigInt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/math/toBigInt.ts"],"sourcesContent":["import { BigDecimalish } from './bigDecimal';\nimport { toIntegerString } from './toIntegerString';\n\n/**\n * Converts a BigDecimalish value to bigint\n *\n * @param val\n */\nexport function toBigInt(val: BigDecimalish): bigint {\n return BigInt(toIntegerString(val));\n}\n"],"mappings":";;;AACA,SAAS,uBAAuB;AAOzB,SAAS,SAAS,KAA4B;AACnD,SAAO,OAAO,gBAAgB,GAAG,CAAC;AACpC;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/math/toIntegerString.ts
|
|
21
|
+
var toIntegerString_exports = {};
|
|
22
|
+
__export(toIntegerString_exports, {
|
|
23
|
+
toIntegerString: () => toIntegerString
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(toIntegerString_exports);
|
|
26
|
+
var import_bigDecimal = require("./bigDecimal.cjs");
|
|
27
|
+
function toIntegerString(val) {
|
|
28
|
+
return (0, import_bigDecimal.toBigDecimal)(val).toFixed(0);
|
|
29
|
+
}
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
toIntegerString
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=toIntegerString.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/math/toIntegerString.ts"],"sourcesContent":["import { BigDecimalish, toBigDecimal } from './bigDecimal';\n\n/**\n * Converts a BigDecimalish value to string\n *\n * @param val\n */\nexport function toIntegerString(val: BigDecimalish): string {\n // toFixed is required as toString gives values with `e`\n return toBigDecimal(val).toFixed(0);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAA4C;AAOrC,SAAS,gBAAgB,KAA4B;AAE1D,aAAO,gCAAa,GAAG,EAAE,QAAQ,CAAC;AACpC;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../../chunk-5WRI5ZAA.js";
|
|
2
|
+
|
|
3
|
+
// src/utils/math/toIntegerString.ts
|
|
4
|
+
import { toBigDecimal } from "./bigDecimal.js";
|
|
5
|
+
function toIntegerString(val) {
|
|
6
|
+
return toBigDecimal(val).toFixed(0);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
toIntegerString
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=toIntegerString.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/math/toIntegerString.ts"],"sourcesContent":["import { BigDecimalish, toBigDecimal } from './bigDecimal';\n\n/**\n * Converts a BigDecimalish value to string\n *\n * @param val\n */\nexport function toIntegerString(val: BigDecimalish): string {\n // toFixed is required as toString gives values with `e`\n return toBigDecimal(val).toFixed(0);\n}\n"],"mappings":";;;AAAA,SAAwB,oBAAoB;AAOrC,SAAS,gBAAgB,KAA4B;AAE1D,SAAO,aAAa,GAAG,EAAE,QAAQ,CAAC;AACpC;","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/orders/appendix/appendixTWAPValue.ts
|
|
21
|
+
var appendixTWAPValue_exports = {};
|
|
22
|
+
__export(appendixTWAPValue_exports, {
|
|
23
|
+
packTWAPOrderAppendixValue: () => packTWAPOrderAppendixValue,
|
|
24
|
+
unpackTWAPOrderAppendixValue: () => unpackTWAPOrderAppendixValue
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(appendixTWAPValue_exports);
|
|
27
|
+
var import_math = require("../../math/index.cjs");
|
|
28
|
+
function packTWAPOrderAppendixValue({
|
|
29
|
+
numOrders,
|
|
30
|
+
slippageFrac
|
|
31
|
+
}) {
|
|
32
|
+
const numOrdersBigInt = (0, import_math.toBigInt)(numOrders);
|
|
33
|
+
const slippageX6BigInt = (0, import_math.toBigInt)((0, import_math.addDecimals)(slippageFrac, 6));
|
|
34
|
+
return (numOrdersBigInt & 0xffffffffn) << 64n | (slippageX6BigInt & 0xffffffffn) << 32n | // The last reserved 32 bits are set to 0
|
|
35
|
+
0n & 0xffffffffn;
|
|
36
|
+
}
|
|
37
|
+
function unpackTWAPOrderAppendixValue(value) {
|
|
38
|
+
const numOrders = value >> 64n & 0xffffffffn;
|
|
39
|
+
const slippageX6 = value >> 32n & 0xffffffffn;
|
|
40
|
+
return {
|
|
41
|
+
numOrders: Number(numOrders),
|
|
42
|
+
slippageFrac: (0, import_math.removeDecimals)(slippageX6, 6).toNumber()
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
packTWAPOrderAppendixValue,
|
|
48
|
+
unpackTWAPOrderAppendixValue
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=appendixTWAPValue.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/orders/appendix/appendixTWAPValue.ts"],"sourcesContent":["import { OrderAppendixTWAPFields } from '../../../types/orderAppendixTypes';\nimport { addDecimals, removeDecimals, toBigInt } from '../../math';\n\n/**\n * Packs the provided fields into a single 96-bit bigint.\n *\n * Bit layout (MSB → LSB):\n * | times | slippage_x6 | reserved |\n * |-----------|-------------|----------|\n * | 95..64 | 63..32 | 31..0 |\n * | 32 bits | 32 bits | 32 bits |\n *\n * - `times` occupies bits 95..64 (most significant 32 bits)\n * - `slippage_x6` occupies bits 63..32 (middle 32 bits)\n * - `reserved` occupies bits 31..0 (least significant 32 bits)\n */\nexport function packTWAPOrderAppendixValue({\n numOrders,\n slippageFrac,\n}: OrderAppendixTWAPFields): bigint {\n const numOrdersBigInt = toBigInt(numOrders);\n const slippageX6BigInt = toBigInt(addDecimals(slippageFrac, 6));\n\n return (\n ((numOrdersBigInt & 0xffffffffn) << 64n) |\n ((slippageX6BigInt & 0xffffffffn) << 32n) |\n // The last reserved 32 bits are set to 0\n (0n & 0xffffffffn)\n );\n}\n\n/**\n * Unpacks a 96-bit bigint into its component fields for TWAP orders.\n *\n * @param value 96-bit bigint to unpack\n * @returns Object with:\n * - times: number, from bits 95..64\n * - slippage_x6: number, from bits 63..32\n * - reserved: number, from bits 31..0\n */\nexport function unpackTWAPOrderAppendixValue(\n value: bigint,\n): OrderAppendixTWAPFields {\n const numOrders = (value >> 64n) & 0xffffffffn;\n const slippageX6 = (value >> 32n) & 0xffffffffn;\n\n return {\n numOrders: Number(numOrders),\n slippageFrac: removeDecimals(slippageX6, 6).toNumber(),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAsD;AAe/C,SAAS,2BAA2B;AAAA,EACzC;AAAA,EACA;AACF,GAAoC;AAClC,QAAM,sBAAkB,sBAAS,SAAS;AAC1C,QAAM,uBAAmB,0BAAS,yBAAY,cAAc,CAAC,CAAC;AAE9D,UACI,kBAAkB,gBAAgB,OAClC,mBAAmB,gBAAgB;AAAA,EAEpC,KAAK;AAEV;AAWO,SAAS,6BACd,OACyB;AACzB,QAAM,YAAa,SAAS,MAAO;AACnC,QAAM,aAAc,SAAS,MAAO;AAEpC,SAAO;AAAA,IACL,WAAW,OAAO,SAAS;AAAA,IAC3B,kBAAc,4BAAe,YAAY,CAAC,EAAE,SAAS;AAAA,EACvD;AACF;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { OrderAppendixTWAPFields } from '../../../types/orderAppendixTypes.cjs';
|
|
2
|
+
import '../../math/bigDecimal.cjs';
|
|
3
|
+
import 'bignumber.js';
|
|
4
|
+
import '../../../types/OrderExecutionType.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Packs the provided fields into a single 96-bit bigint.
|
|
8
|
+
*
|
|
9
|
+
* Bit layout (MSB → LSB):
|
|
10
|
+
* | times | slippage_x6 | reserved |
|
|
11
|
+
* |-----------|-------------|----------|
|
|
12
|
+
* | 95..64 | 63..32 | 31..0 |
|
|
13
|
+
* | 32 bits | 32 bits | 32 bits |
|
|
14
|
+
*
|
|
15
|
+
* - `times` occupies bits 95..64 (most significant 32 bits)
|
|
16
|
+
* - `slippage_x6` occupies bits 63..32 (middle 32 bits)
|
|
17
|
+
* - `reserved` occupies bits 31..0 (least significant 32 bits)
|
|
18
|
+
*/
|
|
19
|
+
declare function packTWAPOrderAppendixValue({ numOrders, slippageFrac, }: OrderAppendixTWAPFields): bigint;
|
|
20
|
+
/**
|
|
21
|
+
* Unpacks a 96-bit bigint into its component fields for TWAP orders.
|
|
22
|
+
*
|
|
23
|
+
* @param value 96-bit bigint to unpack
|
|
24
|
+
* @returns Object with:
|
|
25
|
+
* - times: number, from bits 95..64
|
|
26
|
+
* - slippage_x6: number, from bits 63..32
|
|
27
|
+
* - reserved: number, from bits 31..0
|
|
28
|
+
*/
|
|
29
|
+
declare function unpackTWAPOrderAppendixValue(value: bigint): OrderAppendixTWAPFields;
|
|
30
|
+
|
|
31
|
+
export { packTWAPOrderAppendixValue, unpackTWAPOrderAppendixValue };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { OrderAppendixTWAPFields } from '../../../types/orderAppendixTypes.js';
|
|
2
|
+
import '../../math/bigDecimal.js';
|
|
3
|
+
import 'bignumber.js';
|
|
4
|
+
import '../../../types/OrderExecutionType.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Packs the provided fields into a single 96-bit bigint.
|
|
8
|
+
*
|
|
9
|
+
* Bit layout (MSB → LSB):
|
|
10
|
+
* | times | slippage_x6 | reserved |
|
|
11
|
+
* |-----------|-------------|----------|
|
|
12
|
+
* | 95..64 | 63..32 | 31..0 |
|
|
13
|
+
* | 32 bits | 32 bits | 32 bits |
|
|
14
|
+
*
|
|
15
|
+
* - `times` occupies bits 95..64 (most significant 32 bits)
|
|
16
|
+
* - `slippage_x6` occupies bits 63..32 (middle 32 bits)
|
|
17
|
+
* - `reserved` occupies bits 31..0 (least significant 32 bits)
|
|
18
|
+
*/
|
|
19
|
+
declare function packTWAPOrderAppendixValue({ numOrders, slippageFrac, }: OrderAppendixTWAPFields): bigint;
|
|
20
|
+
/**
|
|
21
|
+
* Unpacks a 96-bit bigint into its component fields for TWAP orders.
|
|
22
|
+
*
|
|
23
|
+
* @param value 96-bit bigint to unpack
|
|
24
|
+
* @returns Object with:
|
|
25
|
+
* - times: number, from bits 95..64
|
|
26
|
+
* - slippage_x6: number, from bits 63..32
|
|
27
|
+
* - reserved: number, from bits 31..0
|
|
28
|
+
*/
|
|
29
|
+
declare function unpackTWAPOrderAppendixValue(value: bigint): OrderAppendixTWAPFields;
|
|
30
|
+
|
|
31
|
+
export { packTWAPOrderAppendixValue, unpackTWAPOrderAppendixValue };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "../../../chunk-5WRI5ZAA.js";
|
|
2
|
+
|
|
3
|
+
// src/utils/orders/appendix/appendixTWAPValue.ts
|
|
4
|
+
import { addDecimals, removeDecimals, toBigInt } from "../../math/index.js";
|
|
5
|
+
function packTWAPOrderAppendixValue({
|
|
6
|
+
numOrders,
|
|
7
|
+
slippageFrac
|
|
8
|
+
}) {
|
|
9
|
+
const numOrdersBigInt = toBigInt(numOrders);
|
|
10
|
+
const slippageX6BigInt = toBigInt(addDecimals(slippageFrac, 6));
|
|
11
|
+
return (numOrdersBigInt & 0xffffffffn) << 64n | (slippageX6BigInt & 0xffffffffn) << 32n | // The last reserved 32 bits are set to 0
|
|
12
|
+
0n & 0xffffffffn;
|
|
13
|
+
}
|
|
14
|
+
function unpackTWAPOrderAppendixValue(value) {
|
|
15
|
+
const numOrders = value >> 64n & 0xffffffffn;
|
|
16
|
+
const slippageX6 = value >> 32n & 0xffffffffn;
|
|
17
|
+
return {
|
|
18
|
+
numOrders: Number(numOrders),
|
|
19
|
+
slippageFrac: removeDecimals(slippageX6, 6).toNumber()
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
packTWAPOrderAppendixValue,
|
|
24
|
+
unpackTWAPOrderAppendixValue
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=appendixTWAPValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/orders/appendix/appendixTWAPValue.ts"],"sourcesContent":["import { OrderAppendixTWAPFields } from '../../../types/orderAppendixTypes';\nimport { addDecimals, removeDecimals, toBigInt } from '../../math';\n\n/**\n * Packs the provided fields into a single 96-bit bigint.\n *\n * Bit layout (MSB → LSB):\n * | times | slippage_x6 | reserved |\n * |-----------|-------------|----------|\n * | 95..64 | 63..32 | 31..0 |\n * | 32 bits | 32 bits | 32 bits |\n *\n * - `times` occupies bits 95..64 (most significant 32 bits)\n * - `slippage_x6` occupies bits 63..32 (middle 32 bits)\n * - `reserved` occupies bits 31..0 (least significant 32 bits)\n */\nexport function packTWAPOrderAppendixValue({\n numOrders,\n slippageFrac,\n}: OrderAppendixTWAPFields): bigint {\n const numOrdersBigInt = toBigInt(numOrders);\n const slippageX6BigInt = toBigInt(addDecimals(slippageFrac, 6));\n\n return (\n ((numOrdersBigInt & 0xffffffffn) << 64n) |\n ((slippageX6BigInt & 0xffffffffn) << 32n) |\n // The last reserved 32 bits are set to 0\n (0n & 0xffffffffn)\n );\n}\n\n/**\n * Unpacks a 96-bit bigint into its component fields for TWAP orders.\n *\n * @param value 96-bit bigint to unpack\n * @returns Object with:\n * - times: number, from bits 95..64\n * - slippage_x6: number, from bits 63..32\n * - reserved: number, from bits 31..0\n */\nexport function unpackTWAPOrderAppendixValue(\n value: bigint,\n): OrderAppendixTWAPFields {\n const numOrders = (value >> 64n) & 0xffffffffn;\n const slippageX6 = (value >> 32n) & 0xffffffffn;\n\n return {\n numOrders: Number(numOrders),\n slippageFrac: removeDecimals(slippageX6, 6).toNumber(),\n };\n}\n"],"mappings":";;;AACA,SAAS,aAAa,gBAAgB,gBAAgB;AAe/C,SAAS,2BAA2B;AAAA,EACzC;AAAA,EACA;AACF,GAAoC;AAClC,QAAM,kBAAkB,SAAS,SAAS;AAC1C,QAAM,mBAAmB,SAAS,YAAY,cAAc,CAAC,CAAC;AAE9D,UACI,kBAAkB,gBAAgB,OAClC,mBAAmB,gBAAgB;AAAA,EAEpC,KAAK;AAEV;AAWO,SAAS,6BACd,OACyB;AACzB,QAAM,YAAa,SAAS,MAAO;AACnC,QAAM,aAAc,SAAS,MAAO;AAEpC,SAAO;AAAA,IACL,WAAW,OAAO,SAAS;AAAA,IAC3B,cAAc,eAAe,YAAY,CAAC,EAAE,SAAS;AAAA,EACvD;AACF;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/orders/appendix/bitMaskValue.ts
|
|
21
|
+
var bitMaskValue_exports = {};
|
|
22
|
+
__export(bitMaskValue_exports, {
|
|
23
|
+
bitMaskValue: () => bitMaskValue
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(bitMaskValue_exports);
|
|
26
|
+
function bitMaskValue(value, bitWidth) {
|
|
27
|
+
const bitMask = (1n << BigInt(bitWidth)) - 1n;
|
|
28
|
+
return BigInt(value) & bitMask;
|
|
29
|
+
}
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
bitMaskValue
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=bitMaskValue.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/orders/appendix/bitMaskValue.ts"],"sourcesContent":["/**\n * Returns the value masked to the specified bit width.\n *\n * @param {bigint} value - The value to be masked.\n * @param {number} bitWidth - The bit width for masking.\n * @returns {bigint} - The masked value.\n */\nexport function bitMaskValue(value: bigint | number, bitWidth: number): bigint {\n const bitMask = (1n << BigInt(bitWidth)) - 1n;\n return BigInt(value) & bitMask;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,aAAa,OAAwB,UAA0B;AAC7E,QAAM,WAAW,MAAM,OAAO,QAAQ,KAAK;AAC3C,SAAO,OAAO,KAAK,IAAI;AACzB;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the value masked to the specified bit width.
|
|
3
|
+
*
|
|
4
|
+
* @param {bigint} value - The value to be masked.
|
|
5
|
+
* @param {number} bitWidth - The bit width for masking.
|
|
6
|
+
* @returns {bigint} - The masked value.
|
|
7
|
+
*/
|
|
8
|
+
declare function bitMaskValue(value: bigint | number, bitWidth: number): bigint;
|
|
9
|
+
|
|
10
|
+
export { bitMaskValue };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the value masked to the specified bit width.
|
|
3
|
+
*
|
|
4
|
+
* @param {bigint} value - The value to be masked.
|
|
5
|
+
* @param {number} bitWidth - The bit width for masking.
|
|
6
|
+
* @returns {bigint} - The masked value.
|
|
7
|
+
*/
|
|
8
|
+
declare function bitMaskValue(value: bigint | number, bitWidth: number): bigint;
|
|
9
|
+
|
|
10
|
+
export { bitMaskValue };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../../../chunk-5WRI5ZAA.js";
|
|
2
|
+
|
|
3
|
+
// src/utils/orders/appendix/bitMaskValue.ts
|
|
4
|
+
function bitMaskValue(value, bitWidth) {
|
|
5
|
+
const bitMask = (1n << BigInt(bitWidth)) - 1n;
|
|
6
|
+
return BigInt(value) & bitMask;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
bitMaskValue
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=bitMaskValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/orders/appendix/bitMaskValue.ts"],"sourcesContent":["/**\n * Returns the value masked to the specified bit width.\n *\n * @param {bigint} value - The value to be masked.\n * @param {number} bitWidth - The bit width for masking.\n * @returns {bigint} - The masked value.\n */\nexport function bitMaskValue(value: bigint | number, bitWidth: number): bigint {\n const bitMask = (1n << BigInt(bitWidth)) - 1n;\n return BigInt(value) & bitMask;\n}\n"],"mappings":";;;AAOO,SAAS,aAAa,OAAwB,UAA0B;AAC7E,QAAM,WAAW,MAAM,OAAO,QAAQ,KAAK;AAC3C,SAAO,OAAO,KAAK,IAAI;AACzB;","names":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/utils/orders/appendix/index.ts
|
|
18
|
+
var appendix_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(appendix_exports);
|
|
20
|
+
__reExport(appendix_exports, require("./appendixTWAPValue.cjs"), module.exports);
|
|
21
|
+
__reExport(appendix_exports, require("./unpackOrderAppendix.cjs"), module.exports);
|
|
22
|
+
__reExport(appendix_exports, require("./packOrderAppendix.cjs"), module.exports);
|
|
23
|
+
__reExport(appendix_exports, require("./types.cjs"), module.exports);
|
|
24
|
+
__reExport(appendix_exports, require("./bitMaskValue.cjs"), module.exports);
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
...require("./appendixTWAPValue.cjs"),
|
|
28
|
+
...require("./unpackOrderAppendix.cjs"),
|
|
29
|
+
...require("./packOrderAppendix.cjs"),
|
|
30
|
+
...require("./types.cjs"),
|
|
31
|
+
...require("./bitMaskValue.cjs")
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/orders/appendix/index.ts"],"sourcesContent":["export * from './appendixTWAPValue';\nexport * from './unpackOrderAppendix';\nexport * from './packOrderAppendix';\nexport * from './types';\nexport * from './bitMaskValue';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,oCAAd;AACA,6BAAc,sCADd;AAEA,6BAAc,oCAFd;AAGA,6BAAc,wBAHd;AAIA,6BAAc,+BAJd;","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { packTWAPOrderAppendixValue, unpackTWAPOrderAppendixValue } from './appendixTWAPValue.cjs';
|
|
2
|
+
export { unpackOrderAppendix } from './unpackOrderAppendix.cjs';
|
|
3
|
+
export { packOrderAppendix } from './packOrderAppendix.cjs';
|
|
4
|
+
export { PackedOrderAppendixBits } from './types.cjs';
|
|
5
|
+
export { bitMaskValue } from './bitMaskValue.cjs';
|
|
6
|
+
import '../../../types/orderAppendixTypes.cjs';
|
|
7
|
+
import '../../math/bigDecimal.cjs';
|
|
8
|
+
import 'bignumber.js';
|
|
9
|
+
import '../../../types/OrderExecutionType.cjs';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { packTWAPOrderAppendixValue, unpackTWAPOrderAppendixValue } from './appendixTWAPValue.js';
|
|
2
|
+
export { unpackOrderAppendix } from './unpackOrderAppendix.js';
|
|
3
|
+
export { packOrderAppendix } from './packOrderAppendix.js';
|
|
4
|
+
export { PackedOrderAppendixBits } from './types.js';
|
|
5
|
+
export { bitMaskValue } from './bitMaskValue.js';
|
|
6
|
+
import '../../../types/orderAppendixTypes.js';
|
|
7
|
+
import '../../math/bigDecimal.js';
|
|
8
|
+
import 'bignumber.js';
|
|
9
|
+
import '../../../types/OrderExecutionType.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// src/utils/orders/appendix/index.ts
|
|
2
|
+
export * from "./appendixTWAPValue.js";
|
|
3
|
+
export * from "./unpackOrderAppendix.js";
|
|
4
|
+
export * from "./packOrderAppendix.js";
|
|
5
|
+
export * from "./types.js";
|
|
6
|
+
export * from "./bitMaskValue.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/orders/appendix/index.ts"],"sourcesContent":["export * from './appendixTWAPValue';\nexport * from './unpackOrderAppendix';\nexport * from './packOrderAppendix';\nexport * from './types';\nexport * from './bitMaskValue';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|