@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
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export { ERC20_ABI } from './abis/ERC20.cjs';
|
|
2
|
+
export { MOCK_ERC20_ABI } from './abis/MockERC20.cjs';
|
|
3
|
+
export { WITHDRAW_POOL_ABI } from './abis/WithdrawPool.cjs';
|
|
4
|
+
export { SPOT_ENGINE_ABI } from './abis/SpotEngine.cjs';
|
|
5
|
+
export { QUERIER_ABI } from './abis/Querier.cjs';
|
|
6
|
+
export { PERP_ENGINE_ABI } from './abis/PerpEngine.cjs';
|
|
7
|
+
export { ENDPOINT_ABI } from './abis/Endpoint.cjs';
|
|
8
|
+
export { CLEARINGHOUSE_ABI } from './abis/Clearinghouse.cjs';
|
|
9
|
+
export { NADO_ABIS, NadoAbis, NadoContractName } from './abis/nadoAbis.cjs';
|
|
10
|
+
export { CHAIN_ENV_TO_CHAIN, CHAIN_ID_TO_CHAIN_ENV } from './consts/chainEnvToChain.cjs';
|
|
11
|
+
export { NLP_PRODUCT_ID, QUOTE_PRODUCT_ID } from './consts/productIds.cjs';
|
|
12
|
+
export { NADO_DEPLOYMENTS, NadoDeploymentAddresses } from './deployments/index.cjs';
|
|
13
|
+
export { getSignedTransactionRequest } from './eip712/getSignedTransactionRequest.cjs';
|
|
14
|
+
export { getNadoEIP712Values } from './eip712/getNadoEIP712Values.cjs';
|
|
15
|
+
export { getNadoEIP712Types } from './eip712/getNadoEIP712Types.cjs';
|
|
16
|
+
export { getNadoEIP712PrimaryType } from './eip712/getNadoEIP712PrimaryType.cjs';
|
|
17
|
+
export { getNadoEIP712Domain } from './eip712/getNadoEIP712Domain.cjs';
|
|
18
|
+
export { getOrderDigest } from './eip712/orderDigest.cjs';
|
|
19
|
+
export { SignableRequestType, SignableRequestTypeToParams } from './eip712/signableRequestType.cjs';
|
|
20
|
+
export { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712OrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams, SignedEIP712OrderParams, SignedTx } from './eip712/signatureParamTypes.cjs';
|
|
21
|
+
export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712/eip712ValueTypes.cjs';
|
|
22
|
+
export { getOrderVerifyingAddress } from './eip712/getOrderVerifyingAddress.cjs';
|
|
23
|
+
export { encodeSignedOrder, encodeSignedWithdrawCollateralTx } from './encoding/encoding.cjs';
|
|
24
|
+
export { ApproveDepositAllowanceParams, approveDepositAllowance } from './execute/approveDepositAllowance.cjs';
|
|
25
|
+
export { DepositCollateralParams, depositCollateral } from './execute/depositCollateral.cjs';
|
|
26
|
+
export { Balance, BalanceHealthContributions, BalanceSide, BalanceWithProduct, PerpBalance, PerpBalanceWithProduct, SpotBalance, SpotBalanceWithProduct } from './types/balanceTypes.cjs';
|
|
27
|
+
export { Bytes } from './types/bytes.cjs';
|
|
28
|
+
export { ALL_CHAIN_ENVS, ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS } from './types/ChainEnv.cjs';
|
|
29
|
+
export { HealthGroup, HealthStatus, HealthStatusByType, HealthType } from './types/healthTypes.cjs';
|
|
30
|
+
export { Market, MarketWithProduct, PerpMarket, SpotMarket } from './types/marketTypes.cjs';
|
|
31
|
+
export { PerpProduct, Product, ProductEngineType, SpotProduct, toProductEngineType } from './types/productTypes.cjs';
|
|
32
|
+
export { Subaccount, SubaccountBytes32, SubaccountNameBytes12 } from './types/subaccountTypes.cjs';
|
|
33
|
+
export { NadoContracts, WithContract, WithContracts } from './types/nadoContractTypes.cjs';
|
|
34
|
+
export { AccountWithPrivateKey, ContractInstance, WalletClientWithAccount, WriteableContractInstance } from './types/viemTypes.cjs';
|
|
35
|
+
export { OrderExecutionType } from './types/OrderExecutionType.cjs';
|
|
36
|
+
export { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTWAPFields, OrderAppendixTriggerType } from './types/orderAppendixTypes.cjs';
|
|
37
|
+
export { getOrderNonce, getRecvTimeFromOrderNonce } from './utils/orders/orderNonce.cjs';
|
|
38
|
+
export { getDefaultRecvTime } from './utils/orders/recvTime.cjs';
|
|
39
|
+
export { packTWAPOrderAppendixValue, unpackTWAPOrderAppendixValue } from './utils/orders/appendix/appendixTWAPValue.cjs';
|
|
40
|
+
export { unpackOrderAppendix } from './utils/orders/appendix/unpackOrderAppendix.cjs';
|
|
41
|
+
export { packOrderAppendix } from './utils/orders/appendix/packOrderAppendix.cjs';
|
|
42
|
+
export { PackedOrderAppendixBits } from './utils/orders/appendix/types.cjs';
|
|
43
|
+
export { bitMaskValue } from './utils/orders/appendix/bitMaskValue.cjs';
|
|
44
|
+
export { calcBorrowRateForTimeRange, calcBorrowRatePerSecond, calcRealizedDepositRateForTimeRange, calcTotalBorrowed, calcTotalDeposited, calcUtilizationRatio } from './utils/interest.cjs';
|
|
45
|
+
export { isPerpBalance, isPerpProduct, isSpotBalance, isSpotProduct } from './utils/productTypeFilter.cjs';
|
|
46
|
+
export { calcPerpBalanceNotionalValue, calcPerpBalanceValue, calcSpotBalanceValue } from './utils/balanceValue.cjs';
|
|
47
|
+
export { subaccountFromBytes32, subaccountFromHex, subaccountNameBytesToStr, subaccountNameToBytes12, subaccountToBytes32, subaccountToHex } from './utils/bytes32.cjs';
|
|
48
|
+
export { createDeterministicLinkedSignerPrivateKey } from './utils/createDeterministicLinkedSignerPrivateKey.cjs';
|
|
49
|
+
export { isWriteableContract } from './utils/isWriteableContract.cjs';
|
|
50
|
+
export { WalletNotProvidedError } from './utils/errors/WalletNotProvidedError.cjs';
|
|
51
|
+
export { BigDecimalish, toBigDecimal } from './utils/math/bigDecimal.cjs';
|
|
52
|
+
export { toIntegerString } from './utils/math/toIntegerString.cjs';
|
|
53
|
+
export { toBigInt } from './utils/math/toBigInt.cjs';
|
|
54
|
+
export { clampBigDecimal } from './utils/math/clamp.cjs';
|
|
55
|
+
export { sumBigDecimalBy } from './utils/math/sumBigDecimalBy.cjs';
|
|
56
|
+
export { NADO_PRODUCT_DECIMALS, addDecimals, removeDecimals } from './utils/math/decimalAdjustment.cjs';
|
|
57
|
+
export { BigDecimals } from './utils/math/BigDecimals.cjs';
|
|
58
|
+
export { AsyncResult, asyncResult } from './utils/asyncResult.cjs';
|
|
59
|
+
export { getValidatedAddress } from './utils/getValidatedAddress.cjs';
|
|
60
|
+
export { getValidatedHex } from './utils/getValidatedHex.cjs';
|
|
61
|
+
export { mapValues } from './utils/mapValues.cjs';
|
|
62
|
+
export { TimeInSeconds, millisToSeconds, nowInSeconds } from './utils/time.cjs';
|
|
63
|
+
export { toPrintableObject } from './utils/toPrintableObject.cjs';
|
|
64
|
+
export { default as BigDecimal } from 'bignumber.js';
|
|
65
|
+
import 'abitype';
|
|
66
|
+
import 'viem/chains';
|
|
67
|
+
import 'viem';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export { ERC20_ABI } from './abis/ERC20.js';
|
|
2
|
+
export { MOCK_ERC20_ABI } from './abis/MockERC20.js';
|
|
3
|
+
export { WITHDRAW_POOL_ABI } from './abis/WithdrawPool.js';
|
|
4
|
+
export { SPOT_ENGINE_ABI } from './abis/SpotEngine.js';
|
|
5
|
+
export { QUERIER_ABI } from './abis/Querier.js';
|
|
6
|
+
export { PERP_ENGINE_ABI } from './abis/PerpEngine.js';
|
|
7
|
+
export { ENDPOINT_ABI } from './abis/Endpoint.js';
|
|
8
|
+
export { CLEARINGHOUSE_ABI } from './abis/Clearinghouse.js';
|
|
9
|
+
export { NADO_ABIS, NadoAbis, NadoContractName } from './abis/nadoAbis.js';
|
|
10
|
+
export { CHAIN_ENV_TO_CHAIN, CHAIN_ID_TO_CHAIN_ENV } from './consts/chainEnvToChain.js';
|
|
11
|
+
export { NLP_PRODUCT_ID, QUOTE_PRODUCT_ID } from './consts/productIds.js';
|
|
12
|
+
export { NADO_DEPLOYMENTS, NadoDeploymentAddresses } from './deployments/index.js';
|
|
13
|
+
export { getSignedTransactionRequest } from './eip712/getSignedTransactionRequest.js';
|
|
14
|
+
export { getNadoEIP712Values } from './eip712/getNadoEIP712Values.js';
|
|
15
|
+
export { getNadoEIP712Types } from './eip712/getNadoEIP712Types.js';
|
|
16
|
+
export { getNadoEIP712PrimaryType } from './eip712/getNadoEIP712PrimaryType.js';
|
|
17
|
+
export { getNadoEIP712Domain } from './eip712/getNadoEIP712Domain.js';
|
|
18
|
+
export { getOrderDigest } from './eip712/orderDigest.js';
|
|
19
|
+
export { SignableRequestType, SignableRequestTypeToParams } from './eip712/signableRequestType.js';
|
|
20
|
+
export { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712OrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams, SignedEIP712OrderParams, SignedTx } from './eip712/signatureParamTypes.js';
|
|
21
|
+
export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712/eip712ValueTypes.js';
|
|
22
|
+
export { getOrderVerifyingAddress } from './eip712/getOrderVerifyingAddress.js';
|
|
23
|
+
export { encodeSignedOrder, encodeSignedWithdrawCollateralTx } from './encoding/encoding.js';
|
|
24
|
+
export { ApproveDepositAllowanceParams, approveDepositAllowance } from './execute/approveDepositAllowance.js';
|
|
25
|
+
export { DepositCollateralParams, depositCollateral } from './execute/depositCollateral.js';
|
|
26
|
+
export { Balance, BalanceHealthContributions, BalanceSide, BalanceWithProduct, PerpBalance, PerpBalanceWithProduct, SpotBalance, SpotBalanceWithProduct } from './types/balanceTypes.js';
|
|
27
|
+
export { Bytes } from './types/bytes.js';
|
|
28
|
+
export { ALL_CHAIN_ENVS, ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS } from './types/ChainEnv.js';
|
|
29
|
+
export { HealthGroup, HealthStatus, HealthStatusByType, HealthType } from './types/healthTypes.js';
|
|
30
|
+
export { Market, MarketWithProduct, PerpMarket, SpotMarket } from './types/marketTypes.js';
|
|
31
|
+
export { PerpProduct, Product, ProductEngineType, SpotProduct, toProductEngineType } from './types/productTypes.js';
|
|
32
|
+
export { Subaccount, SubaccountBytes32, SubaccountNameBytes12 } from './types/subaccountTypes.js';
|
|
33
|
+
export { NadoContracts, WithContract, WithContracts } from './types/nadoContractTypes.js';
|
|
34
|
+
export { AccountWithPrivateKey, ContractInstance, WalletClientWithAccount, WriteableContractInstance } from './types/viemTypes.js';
|
|
35
|
+
export { OrderExecutionType } from './types/OrderExecutionType.js';
|
|
36
|
+
export { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTWAPFields, OrderAppendixTriggerType } from './types/orderAppendixTypes.js';
|
|
37
|
+
export { getOrderNonce, getRecvTimeFromOrderNonce } from './utils/orders/orderNonce.js';
|
|
38
|
+
export { getDefaultRecvTime } from './utils/orders/recvTime.js';
|
|
39
|
+
export { packTWAPOrderAppendixValue, unpackTWAPOrderAppendixValue } from './utils/orders/appendix/appendixTWAPValue.js';
|
|
40
|
+
export { unpackOrderAppendix } from './utils/orders/appendix/unpackOrderAppendix.js';
|
|
41
|
+
export { packOrderAppendix } from './utils/orders/appendix/packOrderAppendix.js';
|
|
42
|
+
export { PackedOrderAppendixBits } from './utils/orders/appendix/types.js';
|
|
43
|
+
export { bitMaskValue } from './utils/orders/appendix/bitMaskValue.js';
|
|
44
|
+
export { calcBorrowRateForTimeRange, calcBorrowRatePerSecond, calcRealizedDepositRateForTimeRange, calcTotalBorrowed, calcTotalDeposited, calcUtilizationRatio } from './utils/interest.js';
|
|
45
|
+
export { isPerpBalance, isPerpProduct, isSpotBalance, isSpotProduct } from './utils/productTypeFilter.js';
|
|
46
|
+
export { calcPerpBalanceNotionalValue, calcPerpBalanceValue, calcSpotBalanceValue } from './utils/balanceValue.js';
|
|
47
|
+
export { subaccountFromBytes32, subaccountFromHex, subaccountNameBytesToStr, subaccountNameToBytes12, subaccountToBytes32, subaccountToHex } from './utils/bytes32.js';
|
|
48
|
+
export { createDeterministicLinkedSignerPrivateKey } from './utils/createDeterministicLinkedSignerPrivateKey.js';
|
|
49
|
+
export { isWriteableContract } from './utils/isWriteableContract.js';
|
|
50
|
+
export { WalletNotProvidedError } from './utils/errors/WalletNotProvidedError.js';
|
|
51
|
+
export { BigDecimalish, toBigDecimal } from './utils/math/bigDecimal.js';
|
|
52
|
+
export { toIntegerString } from './utils/math/toIntegerString.js';
|
|
53
|
+
export { toBigInt } from './utils/math/toBigInt.js';
|
|
54
|
+
export { clampBigDecimal } from './utils/math/clamp.js';
|
|
55
|
+
export { sumBigDecimalBy } from './utils/math/sumBigDecimalBy.js';
|
|
56
|
+
export { NADO_PRODUCT_DECIMALS, addDecimals, removeDecimals } from './utils/math/decimalAdjustment.js';
|
|
57
|
+
export { BigDecimals } from './utils/math/BigDecimals.js';
|
|
58
|
+
export { AsyncResult, asyncResult } from './utils/asyncResult.js';
|
|
59
|
+
export { getValidatedAddress } from './utils/getValidatedAddress.js';
|
|
60
|
+
export { getValidatedHex } from './utils/getValidatedHex.js';
|
|
61
|
+
export { mapValues } from './utils/mapValues.js';
|
|
62
|
+
export { TimeInSeconds, millisToSeconds, nowInSeconds } from './utils/time.js';
|
|
63
|
+
export { toPrintableObject } from './utils/toPrintableObject.js';
|
|
64
|
+
export { default as BigDecimal } from 'bignumber.js';
|
|
65
|
+
import 'abitype';
|
|
66
|
+
import 'viem/chains';
|
|
67
|
+
import 'viem';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "./abis/index.js";
|
|
3
|
+
export * from "./consts/index.js";
|
|
4
|
+
export * from "./deployments/index.js";
|
|
5
|
+
export * from "./eip712/index.js";
|
|
6
|
+
export * from "./encoding/index.js";
|
|
7
|
+
export * from "./execute/index.js";
|
|
8
|
+
export * from "./types/index.js";
|
|
9
|
+
export * from "./utils/index.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './abis';\nexport * from './consts';\nexport * from './deployments';\nexport * from './eip712';\nexport * from './encoding';\nexport * from './execute';\nexport * from './types';\nexport * from './utils';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
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/types/ChainEnv.ts
|
|
21
|
+
var ChainEnv_exports = {};
|
|
22
|
+
__export(ChainEnv_exports, {
|
|
23
|
+
ALL_CHAIN_ENVS: () => ALL_CHAIN_ENVS,
|
|
24
|
+
LOCAL_CHAIN_ENVS: () => LOCAL_CHAIN_ENVS,
|
|
25
|
+
MAINNET_CHAIN_ENVS: () => MAINNET_CHAIN_ENVS,
|
|
26
|
+
TESTNET_CHAIN_ENVS: () => TESTNET_CHAIN_ENVS
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(ChainEnv_exports);
|
|
29
|
+
var LOCAL_CHAIN_ENVS = ["local"];
|
|
30
|
+
var TESTNET_CHAIN_ENVS = ["inkTestnet"];
|
|
31
|
+
var MAINNET_CHAIN_ENVS = ["arbitrum"];
|
|
32
|
+
var ALL_CHAIN_ENVS = [
|
|
33
|
+
...LOCAL_CHAIN_ENVS,
|
|
34
|
+
...TESTNET_CHAIN_ENVS,
|
|
35
|
+
...MAINNET_CHAIN_ENVS
|
|
36
|
+
];
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
ALL_CHAIN_ENVS,
|
|
40
|
+
LOCAL_CHAIN_ENVS,
|
|
41
|
+
MAINNET_CHAIN_ENVS,
|
|
42
|
+
TESTNET_CHAIN_ENVS
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=ChainEnv.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/ChainEnv.ts"],"sourcesContent":["export const LOCAL_CHAIN_ENVS = ['local'] as const satisfies string[];\n\nexport const TESTNET_CHAIN_ENVS = ['inkTestnet'] as const satisfies string[];\n\nexport const MAINNET_CHAIN_ENVS = ['arbitrum'] as const satisfies string[];\n\nexport const ALL_CHAIN_ENVS = [\n ...LOCAL_CHAIN_ENVS,\n ...TESTNET_CHAIN_ENVS,\n ...MAINNET_CHAIN_ENVS,\n] as const satisfies string[];\n\nexport type ChainEnv = (typeof ALL_CHAIN_ENVS)[number];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,mBAAmB,CAAC,OAAO;AAEjC,IAAM,qBAAqB,CAAC,YAAY;AAExC,IAAM,qBAAqB,CAAC,UAAU;AAEtC,IAAM,iBAAiB;AAAA,EAC5B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const LOCAL_CHAIN_ENVS: ["local"];
|
|
2
|
+
declare const TESTNET_CHAIN_ENVS: ["inkTestnet"];
|
|
3
|
+
declare const MAINNET_CHAIN_ENVS: ["arbitrum"];
|
|
4
|
+
declare const ALL_CHAIN_ENVS: ["local", "inkTestnet", "arbitrum"];
|
|
5
|
+
type ChainEnv = (typeof ALL_CHAIN_ENVS)[number];
|
|
6
|
+
|
|
7
|
+
export { ALL_CHAIN_ENVS, type ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const LOCAL_CHAIN_ENVS: ["local"];
|
|
2
|
+
declare const TESTNET_CHAIN_ENVS: ["inkTestnet"];
|
|
3
|
+
declare const MAINNET_CHAIN_ENVS: ["arbitrum"];
|
|
4
|
+
declare const ALL_CHAIN_ENVS: ["local", "inkTestnet", "arbitrum"];
|
|
5
|
+
type ChainEnv = (typeof ALL_CHAIN_ENVS)[number];
|
|
6
|
+
|
|
7
|
+
export { ALL_CHAIN_ENVS, type ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import "../chunk-5WRI5ZAA.js";
|
|
2
|
+
|
|
3
|
+
// src/types/ChainEnv.ts
|
|
4
|
+
var LOCAL_CHAIN_ENVS = ["local"];
|
|
5
|
+
var TESTNET_CHAIN_ENVS = ["inkTestnet"];
|
|
6
|
+
var MAINNET_CHAIN_ENVS = ["arbitrum"];
|
|
7
|
+
var ALL_CHAIN_ENVS = [
|
|
8
|
+
...LOCAL_CHAIN_ENVS,
|
|
9
|
+
...TESTNET_CHAIN_ENVS,
|
|
10
|
+
...MAINNET_CHAIN_ENVS
|
|
11
|
+
];
|
|
12
|
+
export {
|
|
13
|
+
ALL_CHAIN_ENVS,
|
|
14
|
+
LOCAL_CHAIN_ENVS,
|
|
15
|
+
MAINNET_CHAIN_ENVS,
|
|
16
|
+
TESTNET_CHAIN_ENVS
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=ChainEnv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/ChainEnv.ts"],"sourcesContent":["export const LOCAL_CHAIN_ENVS = ['local'] as const satisfies string[];\n\nexport const TESTNET_CHAIN_ENVS = ['inkTestnet'] as const satisfies string[];\n\nexport const MAINNET_CHAIN_ENVS = ['arbitrum'] as const satisfies string[];\n\nexport const ALL_CHAIN_ENVS = [\n ...LOCAL_CHAIN_ENVS,\n ...TESTNET_CHAIN_ENVS,\n ...MAINNET_CHAIN_ENVS,\n] as const satisfies string[];\n\nexport type ChainEnv = (typeof ALL_CHAIN_ENVS)[number];\n"],"mappings":";;;AAAO,IAAM,mBAAmB,CAAC,OAAO;AAEjC,IAAM,qBAAqB,CAAC,YAAY;AAExC,IAAM,qBAAqB,CAAC,UAAU;AAEtC,IAAM,iBAAiB;AAAA,EAC5B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/OrderExecutionType.ts
|
|
17
|
+
var OrderExecutionType_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(OrderExecutionType_exports);
|
|
19
|
+
//# sourceMappingURL=OrderExecutionType.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/OrderExecutionType.ts"],"sourcesContent":["/**\n * Execution behavior of an order that can be sent to the engine:\n * - `default`: Limit order\n * - `ioc`: Immediate or Cancel order\n * - `fok`: Fill or Kill order\n * - `post_only`: Post Only order (will not match against existing orders)\n */\nexport type OrderExecutionType = 'default' | 'ioc' | 'fok' | 'post_only';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution behavior of an order that can be sent to the engine:
|
|
3
|
+
* - `default`: Limit order
|
|
4
|
+
* - `ioc`: Immediate or Cancel order
|
|
5
|
+
* - `fok`: Fill or Kill order
|
|
6
|
+
* - `post_only`: Post Only order (will not match against existing orders)
|
|
7
|
+
*/
|
|
8
|
+
type OrderExecutionType = 'default' | 'ioc' | 'fok' | 'post_only';
|
|
9
|
+
|
|
10
|
+
export type { OrderExecutionType };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution behavior of an order that can be sent to the engine:
|
|
3
|
+
* - `default`: Limit order
|
|
4
|
+
* - `ioc`: Immediate or Cancel order
|
|
5
|
+
* - `fok`: Fill or Kill order
|
|
6
|
+
* - `post_only`: Post Only order (will not match against existing orders)
|
|
7
|
+
*/
|
|
8
|
+
type OrderExecutionType = 'default' | 'ioc' | 'fok' | 'post_only';
|
|
9
|
+
|
|
10
|
+
export type { OrderExecutionType };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=OrderExecutionType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/balanceTypes.ts
|
|
17
|
+
var balanceTypes_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(balanceTypes_exports);
|
|
19
|
+
//# sourceMappingURL=balanceTypes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/balanceTypes.ts"],"sourcesContent":["import { BigDecimal } from '../utils/math';\nimport { HealthType } from './healthTypes';\nimport { PerpProduct, ProductEngineType, SpotProduct } from './productTypes';\n\nexport type BalanceSide = 'long' | 'short';\n\nexport type BalanceHealthContributions = Record<HealthType, BigDecimal>;\n\n/**\n * Shared properties of a product balance\n */\ninterface BaseBalance {\n type: ProductEngineType;\n productId: number;\n // Amount for the balance\n amount: BigDecimal;\n // Contributions to subaccount health\n healthContributions: BalanceHealthContributions;\n}\n\n/**\n * Balance for a perp product\n */\nexport interface PerpBalance extends BaseBalance {\n type: ProductEngineType.PERP;\n /**\n * As there is no \"quote\" product for the perp engine, this is a representation of the net quote balance\n * associated with the position. The entry cost and funding is rolled into this.\n */\n vQuoteBalance: BigDecimal;\n}\n\nexport type PerpBalanceWithProduct = PerpBalance & PerpProduct;\n\n/**\n * Balance for a spot product\n */\nexport interface SpotBalance extends BaseBalance {\n type: ProductEngineType.SPOT;\n}\n\nexport type SpotBalanceWithProduct = SpotBalance & SpotProduct;\n\nexport type Balance = PerpBalance | SpotBalance;\nexport type BalanceWithProduct =\n | SpotBalanceWithProduct\n | PerpBalanceWithProduct;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import BigDecimal from 'bignumber.js';
|
|
2
|
+
import { HealthType } from './healthTypes.cjs';
|
|
3
|
+
import { ProductEngineType, PerpProduct, SpotProduct } from './productTypes.cjs';
|
|
4
|
+
|
|
5
|
+
type BalanceSide = 'long' | 'short';
|
|
6
|
+
type BalanceHealthContributions = Record<HealthType, BigDecimal>;
|
|
7
|
+
/**
|
|
8
|
+
* Shared properties of a product balance
|
|
9
|
+
*/
|
|
10
|
+
interface BaseBalance {
|
|
11
|
+
type: ProductEngineType;
|
|
12
|
+
productId: number;
|
|
13
|
+
amount: BigDecimal;
|
|
14
|
+
healthContributions: BalanceHealthContributions;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Balance for a perp product
|
|
18
|
+
*/
|
|
19
|
+
interface PerpBalance extends BaseBalance {
|
|
20
|
+
type: ProductEngineType.PERP;
|
|
21
|
+
/**
|
|
22
|
+
* As there is no "quote" product for the perp engine, this is a representation of the net quote balance
|
|
23
|
+
* associated with the position. The entry cost and funding is rolled into this.
|
|
24
|
+
*/
|
|
25
|
+
vQuoteBalance: BigDecimal;
|
|
26
|
+
}
|
|
27
|
+
type PerpBalanceWithProduct = PerpBalance & PerpProduct;
|
|
28
|
+
/**
|
|
29
|
+
* Balance for a spot product
|
|
30
|
+
*/
|
|
31
|
+
interface SpotBalance extends BaseBalance {
|
|
32
|
+
type: ProductEngineType.SPOT;
|
|
33
|
+
}
|
|
34
|
+
type SpotBalanceWithProduct = SpotBalance & SpotProduct;
|
|
35
|
+
type Balance = PerpBalance | SpotBalance;
|
|
36
|
+
type BalanceWithProduct = SpotBalanceWithProduct | PerpBalanceWithProduct;
|
|
37
|
+
|
|
38
|
+
export type { Balance, BalanceHealthContributions, BalanceSide, BalanceWithProduct, PerpBalance, PerpBalanceWithProduct, SpotBalance, SpotBalanceWithProduct };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import BigDecimal from 'bignumber.js';
|
|
2
|
+
import { HealthType } from './healthTypes.js';
|
|
3
|
+
import { ProductEngineType, PerpProduct, SpotProduct } from './productTypes.js';
|
|
4
|
+
|
|
5
|
+
type BalanceSide = 'long' | 'short';
|
|
6
|
+
type BalanceHealthContributions = Record<HealthType, BigDecimal>;
|
|
7
|
+
/**
|
|
8
|
+
* Shared properties of a product balance
|
|
9
|
+
*/
|
|
10
|
+
interface BaseBalance {
|
|
11
|
+
type: ProductEngineType;
|
|
12
|
+
productId: number;
|
|
13
|
+
amount: BigDecimal;
|
|
14
|
+
healthContributions: BalanceHealthContributions;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Balance for a perp product
|
|
18
|
+
*/
|
|
19
|
+
interface PerpBalance extends BaseBalance {
|
|
20
|
+
type: ProductEngineType.PERP;
|
|
21
|
+
/**
|
|
22
|
+
* As there is no "quote" product for the perp engine, this is a representation of the net quote balance
|
|
23
|
+
* associated with the position. The entry cost and funding is rolled into this.
|
|
24
|
+
*/
|
|
25
|
+
vQuoteBalance: BigDecimal;
|
|
26
|
+
}
|
|
27
|
+
type PerpBalanceWithProduct = PerpBalance & PerpProduct;
|
|
28
|
+
/**
|
|
29
|
+
* Balance for a spot product
|
|
30
|
+
*/
|
|
31
|
+
interface SpotBalance extends BaseBalance {
|
|
32
|
+
type: ProductEngineType.SPOT;
|
|
33
|
+
}
|
|
34
|
+
type SpotBalanceWithProduct = SpotBalance & SpotProduct;
|
|
35
|
+
type Balance = PerpBalance | SpotBalance;
|
|
36
|
+
type BalanceWithProduct = SpotBalanceWithProduct | PerpBalanceWithProduct;
|
|
37
|
+
|
|
38
|
+
export type { Balance, BalanceHealthContributions, BalanceSide, BalanceWithProduct, PerpBalance, PerpBalanceWithProduct, SpotBalance, SpotBalanceWithProduct };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=balanceTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/bytes.ts
|
|
17
|
+
var bytes_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(bytes_exports);
|
|
19
|
+
//# sourceMappingURL=bytes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/bytes.ts"],"sourcesContent":["export type Bytes = Uint8Array;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=bytes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/healthTypes.ts
|
|
17
|
+
var healthTypes_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(healthTypes_exports);
|
|
19
|
+
//# sourceMappingURL=healthTypes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/healthTypes.ts"],"sourcesContent":["import { BigDecimal } from '../utils/math';\n\nexport type HealthType = 'maintenance' | 'initial' | 'unweighted';\n\nexport interface HealthStatus {\n health: BigDecimal;\n assets: BigDecimal;\n liabilities: BigDecimal;\n}\n\nexport type HealthStatusByType = Record<HealthType, HealthStatus>;\n\n// Represents a \"linked\" pair of spot & perp product IDs used for spread health calculations\nexport interface HealthGroup {\n spotProductId: number;\n perpProductId: number;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import BigDecimal from 'bignumber.js';
|
|
2
|
+
|
|
3
|
+
type HealthType = 'maintenance' | 'initial' | 'unweighted';
|
|
4
|
+
interface HealthStatus {
|
|
5
|
+
health: BigDecimal;
|
|
6
|
+
assets: BigDecimal;
|
|
7
|
+
liabilities: BigDecimal;
|
|
8
|
+
}
|
|
9
|
+
type HealthStatusByType = Record<HealthType, HealthStatus>;
|
|
10
|
+
interface HealthGroup {
|
|
11
|
+
spotProductId: number;
|
|
12
|
+
perpProductId: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type { HealthGroup, HealthStatus, HealthStatusByType, HealthType };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import BigDecimal from 'bignumber.js';
|
|
2
|
+
|
|
3
|
+
type HealthType = 'maintenance' | 'initial' | 'unweighted';
|
|
4
|
+
interface HealthStatus {
|
|
5
|
+
health: BigDecimal;
|
|
6
|
+
assets: BigDecimal;
|
|
7
|
+
liabilities: BigDecimal;
|
|
8
|
+
}
|
|
9
|
+
type HealthStatusByType = Record<HealthType, HealthStatus>;
|
|
10
|
+
interface HealthGroup {
|
|
11
|
+
spotProductId: number;
|
|
12
|
+
perpProductId: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type { HealthGroup, HealthStatus, HealthStatusByType, HealthType };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=healthTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
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/types/index.ts
|
|
18
|
+
var types_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(types_exports);
|
|
20
|
+
__reExport(types_exports, require("./balanceTypes.cjs"), module.exports);
|
|
21
|
+
__reExport(types_exports, require("./bytes.cjs"), module.exports);
|
|
22
|
+
__reExport(types_exports, require("./ChainEnv.cjs"), module.exports);
|
|
23
|
+
__reExport(types_exports, require("./healthTypes.cjs"), module.exports);
|
|
24
|
+
__reExport(types_exports, require("./marketTypes.cjs"), module.exports);
|
|
25
|
+
__reExport(types_exports, require("./productTypes.cjs"), module.exports);
|
|
26
|
+
__reExport(types_exports, require("./subaccountTypes.cjs"), module.exports);
|
|
27
|
+
__reExport(types_exports, require("./nadoContractTypes.cjs"), module.exports);
|
|
28
|
+
__reExport(types_exports, require("./viemTypes.cjs"), module.exports);
|
|
29
|
+
__reExport(types_exports, require("./OrderExecutionType.cjs"), module.exports);
|
|
30
|
+
__reExport(types_exports, require("./orderAppendixTypes.cjs"), module.exports);
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
...require("./balanceTypes.cjs"),
|
|
34
|
+
...require("./bytes.cjs"),
|
|
35
|
+
...require("./ChainEnv.cjs"),
|
|
36
|
+
...require("./healthTypes.cjs"),
|
|
37
|
+
...require("./marketTypes.cjs"),
|
|
38
|
+
...require("./productTypes.cjs"),
|
|
39
|
+
...require("./subaccountTypes.cjs"),
|
|
40
|
+
...require("./nadoContractTypes.cjs"),
|
|
41
|
+
...require("./viemTypes.cjs"),
|
|
42
|
+
...require("./OrderExecutionType.cjs"),
|
|
43
|
+
...require("./orderAppendixTypes.cjs")
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './balanceTypes';\nexport * from './bytes';\nexport * from './ChainEnv';\nexport * from './healthTypes';\nexport * from './marketTypes';\nexport * from './productTypes';\nexport * from './subaccountTypes';\nexport * from './nadoContractTypes';\nexport * from './viemTypes';\nexport * from './OrderExecutionType';\nexport * from './orderAppendixTypes';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,+BAAd;AACA,0BAAc,wBADd;AAEA,0BAAc,2BAFd;AAGA,0BAAc,8BAHd;AAIA,0BAAc,8BAJd;AAKA,0BAAc,+BALd;AAMA,0BAAc,kCANd;AAOA,0BAAc,oCAPd;AAQA,0BAAc,4BARd;AASA,0BAAc,qCATd;AAUA,0BAAc,qCAVd;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { Balance, BalanceHealthContributions, BalanceSide, BalanceWithProduct, PerpBalance, PerpBalanceWithProduct, SpotBalance, SpotBalanceWithProduct } from './balanceTypes.cjs';
|
|
2
|
+
export { Bytes } from './bytes.cjs';
|
|
3
|
+
export { ALL_CHAIN_ENVS, ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS } from './ChainEnv.cjs';
|
|
4
|
+
export { HealthGroup, HealthStatus, HealthStatusByType, HealthType } from './healthTypes.cjs';
|
|
5
|
+
export { Market, MarketWithProduct, PerpMarket, SpotMarket } from './marketTypes.cjs';
|
|
6
|
+
export { PerpProduct, Product, ProductEngineType, SpotProduct, toProductEngineType } from './productTypes.cjs';
|
|
7
|
+
export { Subaccount, SubaccountBytes32, SubaccountNameBytes12 } from './subaccountTypes.cjs';
|
|
8
|
+
export { NadoContracts, WithContract, WithContracts } from './nadoContractTypes.cjs';
|
|
9
|
+
export { AccountWithPrivateKey, ContractInstance, WalletClientWithAccount, WriteableContractInstance } from './viemTypes.cjs';
|
|
10
|
+
export { OrderExecutionType } from './OrderExecutionType.cjs';
|
|
11
|
+
export { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTWAPFields, OrderAppendixTriggerType } from './orderAppendixTypes.cjs';
|
|
12
|
+
import 'bignumber.js';
|
|
13
|
+
import '../abis/nadoAbis.cjs';
|
|
14
|
+
import 'viem';
|
|
15
|
+
import '../utils/math/bigDecimal.cjs';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { Balance, BalanceHealthContributions, BalanceSide, BalanceWithProduct, PerpBalance, PerpBalanceWithProduct, SpotBalance, SpotBalanceWithProduct } from './balanceTypes.js';
|
|
2
|
+
export { Bytes } from './bytes.js';
|
|
3
|
+
export { ALL_CHAIN_ENVS, ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS } from './ChainEnv.js';
|
|
4
|
+
export { HealthGroup, HealthStatus, HealthStatusByType, HealthType } from './healthTypes.js';
|
|
5
|
+
export { Market, MarketWithProduct, PerpMarket, SpotMarket } from './marketTypes.js';
|
|
6
|
+
export { PerpProduct, Product, ProductEngineType, SpotProduct, toProductEngineType } from './productTypes.js';
|
|
7
|
+
export { Subaccount, SubaccountBytes32, SubaccountNameBytes12 } from './subaccountTypes.js';
|
|
8
|
+
export { NadoContracts, WithContract, WithContracts } from './nadoContractTypes.js';
|
|
9
|
+
export { AccountWithPrivateKey, ContractInstance, WalletClientWithAccount, WriteableContractInstance } from './viemTypes.js';
|
|
10
|
+
export { OrderExecutionType } from './OrderExecutionType.js';
|
|
11
|
+
export { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTWAPFields, OrderAppendixTriggerType } from './orderAppendixTypes.js';
|
|
12
|
+
import 'bignumber.js';
|
|
13
|
+
import '../abis/nadoAbis.js';
|
|
14
|
+
import 'viem';
|
|
15
|
+
import '../utils/math/bigDecimal.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/types/index.ts
|
|
2
|
+
export * from "./balanceTypes.js";
|
|
3
|
+
export * from "./bytes.js";
|
|
4
|
+
export * from "./ChainEnv.js";
|
|
5
|
+
export * from "./healthTypes.js";
|
|
6
|
+
export * from "./marketTypes.js";
|
|
7
|
+
export * from "./productTypes.js";
|
|
8
|
+
export * from "./subaccountTypes.js";
|
|
9
|
+
export * from "./nadoContractTypes.js";
|
|
10
|
+
export * from "./viemTypes.js";
|
|
11
|
+
export * from "./OrderExecutionType.js";
|
|
12
|
+
export * from "./orderAppendixTypes.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './balanceTypes';\nexport * from './bytes';\nexport * from './ChainEnv';\nexport * from './healthTypes';\nexport * from './marketTypes';\nexport * from './productTypes';\nexport * from './subaccountTypes';\nexport * from './nadoContractTypes';\nexport * from './viemTypes';\nexport * from './OrderExecutionType';\nexport * from './orderAppendixTypes';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|