@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,13 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { NadoContractName } from '../abis/nadoAbis.cjs';
|
|
3
|
+
import { ChainEnv } from '../types/ChainEnv.cjs';
|
|
4
|
+
|
|
5
|
+
type NadoDeploymentAddresses = {
|
|
6
|
+
[name in NadoContractName]: Address;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Known deployment addresses for the Nado contracts
|
|
10
|
+
*/
|
|
11
|
+
declare const NADO_DEPLOYMENTS: Record<ChainEnv, NadoDeploymentAddresses>;
|
|
12
|
+
|
|
13
|
+
export { NADO_DEPLOYMENTS, type NadoDeploymentAddresses };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { NadoContractName } from '../abis/nadoAbis.js';
|
|
3
|
+
import { ChainEnv } from '../types/ChainEnv.js';
|
|
4
|
+
|
|
5
|
+
type NadoDeploymentAddresses = {
|
|
6
|
+
[name in NadoContractName]: Address;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Known deployment addresses for the Nado contracts
|
|
10
|
+
*/
|
|
11
|
+
declare const NADO_DEPLOYMENTS: Record<ChainEnv, NadoDeploymentAddresses>;
|
|
12
|
+
|
|
13
|
+
export { NADO_DEPLOYMENTS, type NadoDeploymentAddresses };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import "../chunk-5WRI5ZAA.js";
|
|
2
|
+
|
|
3
|
+
// src/deployments/index.ts
|
|
4
|
+
import { getValidatedAddress } from "../utils/getValidatedAddress.js";
|
|
5
|
+
import ArbitrumOneCoreDeployment from "./core/deployment.arbitrumOne.json" with { type: "json" };
|
|
6
|
+
import InkSepoliaCoreDeployment from "./core/deployment.InkSepolia.json" with { type: "json" };
|
|
7
|
+
import LocalCoreDeployment from "./core/deployment.localhost.json" with { type: "json" };
|
|
8
|
+
var NADO_DEPLOYMENTS = {
|
|
9
|
+
arbitrum: validateDeployment({
|
|
10
|
+
...ArbitrumOneCoreDeployment
|
|
11
|
+
}),
|
|
12
|
+
inkTestnet: validateDeployment({
|
|
13
|
+
...InkSepoliaCoreDeployment
|
|
14
|
+
}),
|
|
15
|
+
local: validateDeployment({
|
|
16
|
+
...LocalCoreDeployment
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
function validateDeployment(deployment) {
|
|
20
|
+
return {
|
|
21
|
+
clearinghouse: getValidatedAddress(deployment.clearinghouse),
|
|
22
|
+
endpoint: getValidatedAddress(deployment.endpoint),
|
|
23
|
+
perpEngine: getValidatedAddress(deployment.perpEngine),
|
|
24
|
+
querier: getValidatedAddress(deployment.querier),
|
|
25
|
+
spotEngine: getValidatedAddress(deployment.spotEngine),
|
|
26
|
+
withdrawPool: getValidatedAddress(deployment.withdrawPool)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
NADO_DEPLOYMENTS
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/deployments/index.ts"],"sourcesContent":["import { Address } from 'viem';\nimport { NadoContractName } from '../abis/nadoAbis';\n\nimport { ChainEnv } from '../types';\nimport { getValidatedAddress } from '../utils/getValidatedAddress';\nimport ArbitrumOneCoreDeployment from './core/deployment.arbitrumOne.json' with { type: 'json' };\nimport InkSepoliaCoreDeployment from './core/deployment.InkSepolia.json' with { type: 'json' };\nimport LocalCoreDeployment from './core/deployment.localhost.json' with { type: 'json' };\n\nexport type NadoDeploymentAddresses = {\n [name in NadoContractName]: Address;\n};\n\n/**\n * Known deployment addresses for the Nado contracts\n */\nexport const NADO_DEPLOYMENTS: Record<ChainEnv, NadoDeploymentAddresses> = {\n arbitrum: validateDeployment({\n ...ArbitrumOneCoreDeployment,\n }),\n inkTestnet: validateDeployment({\n ...InkSepoliaCoreDeployment,\n }),\n local: validateDeployment({\n ...LocalCoreDeployment,\n }),\n};\n\nfunction validateDeployment(\n deployment: Record<NadoContractName, string>,\n): Record<NadoContractName, Address> {\n return {\n clearinghouse: getValidatedAddress(deployment.clearinghouse),\n endpoint: getValidatedAddress(deployment.endpoint),\n perpEngine: getValidatedAddress(deployment.perpEngine),\n querier: getValidatedAddress(deployment.querier),\n spotEngine: getValidatedAddress(deployment.spotEngine),\n withdrawPool: getValidatedAddress(deployment.withdrawPool),\n };\n}\n"],"mappings":";;;AAIA,SAAS,2BAA2B;AACpC,OAAO,+BAA+B,qCAAqC,KAAK,EAAE,MAAM,OAAO;AAC/F,OAAO,8BAA8B,oCAAoC,KAAK,EAAE,MAAM,OAAO;AAC7F,OAAO,yBAAyB,mCAAmC,KAAK,EAAE,MAAM,OAAO;AAShF,IAAM,mBAA8D;AAAA,EACzE,UAAU,mBAAmB;AAAA,IAC3B,GAAG;AAAA,EACL,CAAC;AAAA,EACD,YAAY,mBAAmB;AAAA,IAC7B,GAAG;AAAA,EACL,CAAC;AAAA,EACD,OAAO,mBAAmB;AAAA,IACxB,GAAG;AAAA,EACL,CAAC;AACH;AAEA,SAAS,mBACP,YACmC;AACnC,SAAO;AAAA,IACL,eAAe,oBAAoB,WAAW,aAAa;AAAA,IAC3D,UAAU,oBAAoB,WAAW,QAAQ;AAAA,IACjD,YAAY,oBAAoB,WAAW,UAAU;AAAA,IACrD,SAAS,oBAAoB,WAAW,OAAO;AAAA,IAC/C,YAAY,oBAAoB,WAAW,UAAU;AAAA,IACrD,cAAc,oBAAoB,WAAW,YAAY;AAAA,EAC3D;AACF;","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/eip712/eip712ValueTypes.ts
|
|
17
|
+
var eip712ValueTypes_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(eip712ValueTypes_exports);
|
|
19
|
+
//# sourceMappingURL=eip712ValueTypes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/eip712/eip712ValueTypes.ts"],"sourcesContent":["import { Hex } from 'viem';\nimport { BigDecimalish } from '../utils/math';\nimport {\n EIP712BurnNlpParams,\n EIP712CancelOrdersParams,\n EIP712CancelProductOrdersParams,\n EIP712LeaderboardAuthenticationParams,\n EIP712LinkSignerParams,\n EIP712LiquidateSubaccountParams,\n EIP712ListTriggerOrdersParams,\n EIP712MintNlpParams,\n EIP712OrderParams,\n EIP712TransferQuoteParams,\n EIP712WithdrawCollateralParams,\n} from './signatureParamTypes';\n\ntype WithEIP712Sender<\n T extends { subaccountOwner: string; subaccountName: string },\n> = Omit<T, 'subaccountOwner' | 'subaccountName'> & {\n // Hex encoded bytes32\n sender: Hex;\n};\n\nexport type EIP712WithdrawCollateralValues =\n WithEIP712Sender<EIP712WithdrawCollateralParams>;\n\nexport type EIP712LiquidateSubaccountValues = Omit<\n WithEIP712Sender<EIP712LiquidateSubaccountParams>,\n 'liquidateeOwner' | 'liquidateeName'\n> & {\n // Hex encoded bytes32\n liquidatee: string;\n};\n\nexport type EIP712OrderValues = Omit<\n WithEIP712Sender<EIP712OrderParams>,\n 'price'\n> & {\n priceX18: BigDecimalish;\n};\n\nexport type EIP712ListTriggerOrdersValues =\n WithEIP712Sender<EIP712ListTriggerOrdersParams>;\n\nexport type EIP712OrderCancellationValues =\n WithEIP712Sender<EIP712CancelOrdersParams>;\n\nexport type EIP712ProductOrdersCancellationValues =\n WithEIP712Sender<EIP712CancelProductOrdersParams>;\n\nexport type EIP712LinkSignerValues = WithEIP712Sender<EIP712LinkSignerParams>;\n\nexport type EIP712TransferQuoteValues = Omit<\n WithEIP712Sender<EIP712TransferQuoteParams>,\n 'recipientSubaccountName'\n> & {\n // Hex encoded bytes32\n recipient: string;\n};\n\nexport type EIP712LeaderboardAuthenticationValues =\n WithEIP712Sender<EIP712LeaderboardAuthenticationParams>;\n\nexport type EIP712MintNlpValues = WithEIP712Sender<EIP712MintNlpParams>;\n\nexport type EIP712BurnNlpValues = WithEIP712Sender<EIP712BurnNlpParams>;\n\n/**\n * All possible requests to be signed, to the EIP712 value interface\n */\nexport interface SignableRequestTypeToEIP712Values {\n burn_nlp: EIP712BurnNlpValues;\n cancel_orders: EIP712OrderCancellationValues;\n cancel_product_orders: EIP712ProductOrdersCancellationValues;\n leaderboard_authentication: EIP712LeaderboardAuthenticationValues;\n link_signer: EIP712LinkSignerValues;\n liquidate_subaccount: EIP712LiquidateSubaccountValues;\n list_trigger_orders: EIP712ListTriggerOrdersValues;\n mint_nlp: EIP712MintNlpValues;\n place_order: EIP712OrderValues;\n transfer_quote: EIP712TransferQuoteValues;\n withdraw_collateral: EIP712WithdrawCollateralValues;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
import { BigDecimalish } from '../utils/math/bigDecimal.cjs';
|
|
3
|
+
import { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712OrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams } from './signatureParamTypes.cjs';
|
|
4
|
+
import 'bignumber.js';
|
|
5
|
+
import '../types/subaccountTypes.cjs';
|
|
6
|
+
import '../types/bytes.cjs';
|
|
7
|
+
|
|
8
|
+
type WithEIP712Sender<T extends {
|
|
9
|
+
subaccountOwner: string;
|
|
10
|
+
subaccountName: string;
|
|
11
|
+
}> = Omit<T, 'subaccountOwner' | 'subaccountName'> & {
|
|
12
|
+
sender: Hex;
|
|
13
|
+
};
|
|
14
|
+
type EIP712WithdrawCollateralValues = WithEIP712Sender<EIP712WithdrawCollateralParams>;
|
|
15
|
+
type EIP712LiquidateSubaccountValues = Omit<WithEIP712Sender<EIP712LiquidateSubaccountParams>, 'liquidateeOwner' | 'liquidateeName'> & {
|
|
16
|
+
liquidatee: string;
|
|
17
|
+
};
|
|
18
|
+
type EIP712OrderValues = Omit<WithEIP712Sender<EIP712OrderParams>, 'price'> & {
|
|
19
|
+
priceX18: BigDecimalish;
|
|
20
|
+
};
|
|
21
|
+
type EIP712ListTriggerOrdersValues = WithEIP712Sender<EIP712ListTriggerOrdersParams>;
|
|
22
|
+
type EIP712OrderCancellationValues = WithEIP712Sender<EIP712CancelOrdersParams>;
|
|
23
|
+
type EIP712ProductOrdersCancellationValues = WithEIP712Sender<EIP712CancelProductOrdersParams>;
|
|
24
|
+
type EIP712LinkSignerValues = WithEIP712Sender<EIP712LinkSignerParams>;
|
|
25
|
+
type EIP712TransferQuoteValues = Omit<WithEIP712Sender<EIP712TransferQuoteParams>, 'recipientSubaccountName'> & {
|
|
26
|
+
recipient: string;
|
|
27
|
+
};
|
|
28
|
+
type EIP712LeaderboardAuthenticationValues = WithEIP712Sender<EIP712LeaderboardAuthenticationParams>;
|
|
29
|
+
type EIP712MintNlpValues = WithEIP712Sender<EIP712MintNlpParams>;
|
|
30
|
+
type EIP712BurnNlpValues = WithEIP712Sender<EIP712BurnNlpParams>;
|
|
31
|
+
/**
|
|
32
|
+
* All possible requests to be signed, to the EIP712 value interface
|
|
33
|
+
*/
|
|
34
|
+
interface SignableRequestTypeToEIP712Values {
|
|
35
|
+
burn_nlp: EIP712BurnNlpValues;
|
|
36
|
+
cancel_orders: EIP712OrderCancellationValues;
|
|
37
|
+
cancel_product_orders: EIP712ProductOrdersCancellationValues;
|
|
38
|
+
leaderboard_authentication: EIP712LeaderboardAuthenticationValues;
|
|
39
|
+
link_signer: EIP712LinkSignerValues;
|
|
40
|
+
liquidate_subaccount: EIP712LiquidateSubaccountValues;
|
|
41
|
+
list_trigger_orders: EIP712ListTriggerOrdersValues;
|
|
42
|
+
mint_nlp: EIP712MintNlpValues;
|
|
43
|
+
place_order: EIP712OrderValues;
|
|
44
|
+
transfer_quote: EIP712TransferQuoteValues;
|
|
45
|
+
withdraw_collateral: EIP712WithdrawCollateralValues;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Hex } from 'viem';
|
|
2
|
+
import { BigDecimalish } from '../utils/math/bigDecimal.js';
|
|
3
|
+
import { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712OrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams } from './signatureParamTypes.js';
|
|
4
|
+
import 'bignumber.js';
|
|
5
|
+
import '../types/subaccountTypes.js';
|
|
6
|
+
import '../types/bytes.js';
|
|
7
|
+
|
|
8
|
+
type WithEIP712Sender<T extends {
|
|
9
|
+
subaccountOwner: string;
|
|
10
|
+
subaccountName: string;
|
|
11
|
+
}> = Omit<T, 'subaccountOwner' | 'subaccountName'> & {
|
|
12
|
+
sender: Hex;
|
|
13
|
+
};
|
|
14
|
+
type EIP712WithdrawCollateralValues = WithEIP712Sender<EIP712WithdrawCollateralParams>;
|
|
15
|
+
type EIP712LiquidateSubaccountValues = Omit<WithEIP712Sender<EIP712LiquidateSubaccountParams>, 'liquidateeOwner' | 'liquidateeName'> & {
|
|
16
|
+
liquidatee: string;
|
|
17
|
+
};
|
|
18
|
+
type EIP712OrderValues = Omit<WithEIP712Sender<EIP712OrderParams>, 'price'> & {
|
|
19
|
+
priceX18: BigDecimalish;
|
|
20
|
+
};
|
|
21
|
+
type EIP712ListTriggerOrdersValues = WithEIP712Sender<EIP712ListTriggerOrdersParams>;
|
|
22
|
+
type EIP712OrderCancellationValues = WithEIP712Sender<EIP712CancelOrdersParams>;
|
|
23
|
+
type EIP712ProductOrdersCancellationValues = WithEIP712Sender<EIP712CancelProductOrdersParams>;
|
|
24
|
+
type EIP712LinkSignerValues = WithEIP712Sender<EIP712LinkSignerParams>;
|
|
25
|
+
type EIP712TransferQuoteValues = Omit<WithEIP712Sender<EIP712TransferQuoteParams>, 'recipientSubaccountName'> & {
|
|
26
|
+
recipient: string;
|
|
27
|
+
};
|
|
28
|
+
type EIP712LeaderboardAuthenticationValues = WithEIP712Sender<EIP712LeaderboardAuthenticationParams>;
|
|
29
|
+
type EIP712MintNlpValues = WithEIP712Sender<EIP712MintNlpParams>;
|
|
30
|
+
type EIP712BurnNlpValues = WithEIP712Sender<EIP712BurnNlpParams>;
|
|
31
|
+
/**
|
|
32
|
+
* All possible requests to be signed, to the EIP712 value interface
|
|
33
|
+
*/
|
|
34
|
+
interface SignableRequestTypeToEIP712Values {
|
|
35
|
+
burn_nlp: EIP712BurnNlpValues;
|
|
36
|
+
cancel_orders: EIP712OrderCancellationValues;
|
|
37
|
+
cancel_product_orders: EIP712ProductOrdersCancellationValues;
|
|
38
|
+
leaderboard_authentication: EIP712LeaderboardAuthenticationValues;
|
|
39
|
+
link_signer: EIP712LinkSignerValues;
|
|
40
|
+
liquidate_subaccount: EIP712LiquidateSubaccountValues;
|
|
41
|
+
list_trigger_orders: EIP712ListTriggerOrdersValues;
|
|
42
|
+
mint_nlp: EIP712MintNlpValues;
|
|
43
|
+
place_order: EIP712OrderValues;
|
|
44
|
+
transfer_quote: EIP712TransferQuoteValues;
|
|
45
|
+
withdraw_collateral: EIP712WithdrawCollateralValues;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=eip712ValueTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
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/eip712/getNadoEIP712Domain.ts
|
|
21
|
+
var getNadoEIP712Domain_exports = {};
|
|
22
|
+
__export(getNadoEIP712Domain_exports, {
|
|
23
|
+
getNadoEIP712Domain: () => getNadoEIP712Domain
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(getNadoEIP712Domain_exports);
|
|
26
|
+
var import_getValidatedAddress = require("../utils/getValidatedAddress.cjs");
|
|
27
|
+
function getNadoEIP712Domain(contractAddress, chainId) {
|
|
28
|
+
return {
|
|
29
|
+
name: "Nado",
|
|
30
|
+
version: "0.0.1",
|
|
31
|
+
chainId,
|
|
32
|
+
verifyingContract: (0, import_getValidatedAddress.getValidatedAddress)(contractAddress)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
getNadoEIP712Domain
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=getNadoEIP712Domain.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/eip712/getNadoEIP712Domain.ts"],"sourcesContent":["import { getValidatedAddress } from '../utils/getValidatedAddress';\nimport { TypedDataDomain } from 'abitype';\n\n/**\n * Gives the EIP712 data domain for order signing\n *\n * @param contractAddress usually the address of the orderbook (for orders) or sequencer (for other operations)\n * @param chainId\n */\nexport function getNadoEIP712Domain(\n contractAddress: string,\n chainId: number,\n): TypedDataDomain {\n return {\n name: 'Nado',\n version: '0.0.1',\n chainId,\n verifyingContract: getValidatedAddress(contractAddress),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAAoC;AAS7B,SAAS,oBACd,iBACA,SACiB;AACjB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA,uBAAmB,gDAAoB,eAAe;AAAA,EACxD;AACF;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypedDataDomain } from 'abitype';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Gives the EIP712 data domain for order signing
|
|
5
|
+
*
|
|
6
|
+
* @param contractAddress usually the address of the orderbook (for orders) or sequencer (for other operations)
|
|
7
|
+
* @param chainId
|
|
8
|
+
*/
|
|
9
|
+
declare function getNadoEIP712Domain(contractAddress: string, chainId: number): TypedDataDomain;
|
|
10
|
+
|
|
11
|
+
export { getNadoEIP712Domain };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypedDataDomain } from 'abitype';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Gives the EIP712 data domain for order signing
|
|
5
|
+
*
|
|
6
|
+
* @param contractAddress usually the address of the orderbook (for orders) or sequencer (for other operations)
|
|
7
|
+
* @param chainId
|
|
8
|
+
*/
|
|
9
|
+
declare function getNadoEIP712Domain(contractAddress: string, chainId: number): TypedDataDomain;
|
|
10
|
+
|
|
11
|
+
export { getNadoEIP712Domain };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "../chunk-5WRI5ZAA.js";
|
|
2
|
+
|
|
3
|
+
// src/eip712/getNadoEIP712Domain.ts
|
|
4
|
+
import { getValidatedAddress } from "../utils/getValidatedAddress.js";
|
|
5
|
+
function getNadoEIP712Domain(contractAddress, chainId) {
|
|
6
|
+
return {
|
|
7
|
+
name: "Nado",
|
|
8
|
+
version: "0.0.1",
|
|
9
|
+
chainId,
|
|
10
|
+
verifyingContract: getValidatedAddress(contractAddress)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
getNadoEIP712Domain
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=getNadoEIP712Domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/eip712/getNadoEIP712Domain.ts"],"sourcesContent":["import { getValidatedAddress } from '../utils/getValidatedAddress';\nimport { TypedDataDomain } from 'abitype';\n\n/**\n * Gives the EIP712 data domain for order signing\n *\n * @param contractAddress usually the address of the orderbook (for orders) or sequencer (for other operations)\n * @param chainId\n */\nexport function getNadoEIP712Domain(\n contractAddress: string,\n chainId: number,\n): TypedDataDomain {\n return {\n name: 'Nado',\n version: '0.0.1',\n chainId,\n verifyingContract: getValidatedAddress(contractAddress),\n };\n}\n"],"mappings":";;;AAAA,SAAS,2BAA2B;AAS7B,SAAS,oBACd,iBACA,SACiB;AACjB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA,mBAAmB,oBAAoB,eAAe;AAAA,EACxD;AACF;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
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/eip712/getNadoEIP712PrimaryType.ts
|
|
21
|
+
var getNadoEIP712PrimaryType_exports = {};
|
|
22
|
+
__export(getNadoEIP712PrimaryType_exports, {
|
|
23
|
+
getNadoEIP712PrimaryType: () => getNadoEIP712PrimaryType
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(getNadoEIP712PrimaryType_exports);
|
|
26
|
+
var import_getNadoEIP712Types = require("./getNadoEIP712Types.cjs");
|
|
27
|
+
function getNadoEIP712PrimaryType(requestType) {
|
|
28
|
+
const types = (0, import_getNadoEIP712Types.getNadoEIP712Types)(requestType);
|
|
29
|
+
return Object.keys(types)[0];
|
|
30
|
+
}
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
getNadoEIP712PrimaryType
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=getNadoEIP712PrimaryType.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/eip712/getNadoEIP712PrimaryType.ts"],"sourcesContent":["import { getNadoEIP712Types } from './getNadoEIP712Types';\nimport { SignableRequestType } from './signableRequestType';\n\n/**\n * Return the primary EIP712 type for a given request\n *\n * @param requestType\n */\nexport function getNadoEIP712PrimaryType(requestType: SignableRequestType) {\n const types = getNadoEIP712Types(requestType);\n // We assume the first key is the primary type. Currently, all Nado EIP712 messages only have one type\n return Object.keys(types)[0];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAmC;AAQ5B,SAAS,yBAAyB,aAAkC;AACzE,QAAM,YAAQ,8CAAmB,WAAW;AAE5C,SAAO,OAAO,KAAK,KAAK,EAAE,CAAC;AAC7B;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SignableRequestType } from './signableRequestType.cjs';
|
|
2
|
+
import './signatureParamTypes.cjs';
|
|
3
|
+
import 'viem';
|
|
4
|
+
import '../types/subaccountTypes.cjs';
|
|
5
|
+
import '../types/bytes.cjs';
|
|
6
|
+
import '../utils/math/bigDecimal.cjs';
|
|
7
|
+
import 'bignumber.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Return the primary EIP712 type for a given request
|
|
11
|
+
*
|
|
12
|
+
* @param requestType
|
|
13
|
+
*/
|
|
14
|
+
declare function getNadoEIP712PrimaryType(requestType: SignableRequestType): string;
|
|
15
|
+
|
|
16
|
+
export { getNadoEIP712PrimaryType };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SignableRequestType } from './signableRequestType.js';
|
|
2
|
+
import './signatureParamTypes.js';
|
|
3
|
+
import 'viem';
|
|
4
|
+
import '../types/subaccountTypes.js';
|
|
5
|
+
import '../types/bytes.js';
|
|
6
|
+
import '../utils/math/bigDecimal.js';
|
|
7
|
+
import 'bignumber.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Return the primary EIP712 type for a given request
|
|
11
|
+
*
|
|
12
|
+
* @param requestType
|
|
13
|
+
*/
|
|
14
|
+
declare function getNadoEIP712PrimaryType(requestType: SignableRequestType): string;
|
|
15
|
+
|
|
16
|
+
export { getNadoEIP712PrimaryType };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "../chunk-5WRI5ZAA.js";
|
|
2
|
+
|
|
3
|
+
// src/eip712/getNadoEIP712PrimaryType.ts
|
|
4
|
+
import { getNadoEIP712Types } from "./getNadoEIP712Types.js";
|
|
5
|
+
function getNadoEIP712PrimaryType(requestType) {
|
|
6
|
+
const types = getNadoEIP712Types(requestType);
|
|
7
|
+
return Object.keys(types)[0];
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
getNadoEIP712PrimaryType
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=getNadoEIP712PrimaryType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/eip712/getNadoEIP712PrimaryType.ts"],"sourcesContent":["import { getNadoEIP712Types } from './getNadoEIP712Types';\nimport { SignableRequestType } from './signableRequestType';\n\n/**\n * Return the primary EIP712 type for a given request\n *\n * @param requestType\n */\nexport function getNadoEIP712PrimaryType(requestType: SignableRequestType) {\n const types = getNadoEIP712Types(requestType);\n // We assume the first key is the primary type. Currently, all Nado EIP712 messages only have one type\n return Object.keys(types)[0];\n}\n"],"mappings":";;;AAAA,SAAS,0BAA0B;AAQ5B,SAAS,yBAAyB,aAAkC;AACzE,QAAM,QAAQ,mBAAmB,WAAW;AAE5C,SAAO,OAAO,KAAK,KAAK,EAAE,CAAC;AAC7B;","names":[]}
|
|
@@ -0,0 +1,129 @@
|
|
|
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/eip712/getNadoEIP712Types.ts
|
|
21
|
+
var getNadoEIP712Types_exports = {};
|
|
22
|
+
__export(getNadoEIP712Types_exports, {
|
|
23
|
+
getNadoEIP712Types: () => getNadoEIP712Types
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(getNadoEIP712Types_exports);
|
|
26
|
+
function getNadoEIP712Types(requestType) {
|
|
27
|
+
switch (requestType) {
|
|
28
|
+
case "withdraw_collateral":
|
|
29
|
+
return {
|
|
30
|
+
WithdrawCollateral: [
|
|
31
|
+
{ name: "sender", type: "bytes32" },
|
|
32
|
+
{ name: "productId", type: "uint32" },
|
|
33
|
+
{ name: "amount", type: "uint128" },
|
|
34
|
+
{ name: "nonce", type: "uint64" }
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
case "place_order":
|
|
38
|
+
return {
|
|
39
|
+
Order: [
|
|
40
|
+
{ name: "sender", type: "bytes32" },
|
|
41
|
+
{ name: "priceX18", type: "int128" },
|
|
42
|
+
{ name: "amount", type: "int128" },
|
|
43
|
+
{ name: "expiration", type: "uint64" },
|
|
44
|
+
{ name: "nonce", type: "uint64" },
|
|
45
|
+
{ name: "appendix", type: "uint128" }
|
|
46
|
+
]
|
|
47
|
+
};
|
|
48
|
+
case "list_trigger_orders":
|
|
49
|
+
return {
|
|
50
|
+
ListTriggerOrders: [
|
|
51
|
+
{ name: "sender", type: "bytes32" },
|
|
52
|
+
{ name: "recvTime", type: "uint64" }
|
|
53
|
+
]
|
|
54
|
+
};
|
|
55
|
+
case "cancel_orders":
|
|
56
|
+
return {
|
|
57
|
+
Cancellation: [
|
|
58
|
+
{ name: "sender", type: "bytes32" },
|
|
59
|
+
{ name: "productIds", type: "uint32[]" },
|
|
60
|
+
{ name: "digests", type: "bytes32[]" },
|
|
61
|
+
{ name: "nonce", type: "uint64" }
|
|
62
|
+
]
|
|
63
|
+
};
|
|
64
|
+
case "cancel_product_orders":
|
|
65
|
+
return {
|
|
66
|
+
CancellationProducts: [
|
|
67
|
+
{ name: "sender", type: "bytes32" },
|
|
68
|
+
{ name: "productIds", type: "uint32[]" },
|
|
69
|
+
{ name: "nonce", type: "uint64" }
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
case "liquidate_subaccount":
|
|
73
|
+
return {
|
|
74
|
+
LiquidateSubaccount: [
|
|
75
|
+
{ name: "sender", type: "bytes32" },
|
|
76
|
+
{ name: "liquidatee", type: "bytes32" },
|
|
77
|
+
{ name: "mode", type: "uint8" },
|
|
78
|
+
{ name: "healthGroup", type: "uint32" },
|
|
79
|
+
{ name: "amount", type: "int128" },
|
|
80
|
+
{ name: "nonce", type: "uint64" }
|
|
81
|
+
]
|
|
82
|
+
};
|
|
83
|
+
case "link_signer":
|
|
84
|
+
return {
|
|
85
|
+
LinkSigner: [
|
|
86
|
+
{ name: "sender", type: "bytes32" },
|
|
87
|
+
{ name: "signer", type: "bytes32" },
|
|
88
|
+
{ name: "nonce", type: "uint64" }
|
|
89
|
+
]
|
|
90
|
+
};
|
|
91
|
+
case "transfer_quote":
|
|
92
|
+
return {
|
|
93
|
+
TransferQuote: [
|
|
94
|
+
{ name: "sender", type: "bytes32" },
|
|
95
|
+
{ name: "recipient", type: "bytes32" },
|
|
96
|
+
{ name: "amount", type: "uint128" },
|
|
97
|
+
{ name: "nonce", type: "uint64" }
|
|
98
|
+
]
|
|
99
|
+
};
|
|
100
|
+
case "leaderboard_authentication":
|
|
101
|
+
return {
|
|
102
|
+
LeaderboardAuthentication: [
|
|
103
|
+
{ name: "sender", type: "bytes32" },
|
|
104
|
+
{ name: "expiration", type: "uint64" }
|
|
105
|
+
]
|
|
106
|
+
};
|
|
107
|
+
case "mint_nlp":
|
|
108
|
+
return {
|
|
109
|
+
MintNlp: [
|
|
110
|
+
{ name: "sender", type: "bytes32" },
|
|
111
|
+
{ name: "quoteAmount", type: "uint128" },
|
|
112
|
+
{ name: "nonce", type: "uint64" }
|
|
113
|
+
]
|
|
114
|
+
};
|
|
115
|
+
case "burn_nlp":
|
|
116
|
+
return {
|
|
117
|
+
BurnNlp: [
|
|
118
|
+
{ name: "sender", type: "bytes32" },
|
|
119
|
+
{ name: "nlpAmount", type: "uint128" },
|
|
120
|
+
{ name: "nonce", type: "uint64" }
|
|
121
|
+
]
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
126
|
+
0 && (module.exports = {
|
|
127
|
+
getNadoEIP712Types
|
|
128
|
+
});
|
|
129
|
+
//# sourceMappingURL=getNadoEIP712Types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/eip712/getNadoEIP712Types.ts"],"sourcesContent":["import { SignableRequestType } from './signableRequestType';\n\ninterface TypedDataField {\n name: string;\n type: string;\n}\n\n/**\n * Return the EIP712 types for a given request\n *\n * @param requestType\n */\nexport function getNadoEIP712Types(\n requestType: SignableRequestType,\n): Record<string, Array<TypedDataField>> {\n switch (requestType) {\n case 'withdraw_collateral':\n return {\n WithdrawCollateral: [\n { name: 'sender', type: 'bytes32' },\n { name: 'productId', type: 'uint32' },\n { name: 'amount', type: 'uint128' },\n { name: 'nonce', type: 'uint64' },\n ],\n };\n case 'place_order':\n return {\n Order: [\n { name: 'sender', type: 'bytes32' },\n { name: 'priceX18', type: 'int128' },\n { name: 'amount', type: 'int128' },\n { name: 'expiration', type: 'uint64' },\n { name: 'nonce', type: 'uint64' },\n { name: 'appendix', type: 'uint128' },\n ],\n };\n case 'list_trigger_orders':\n return {\n ListTriggerOrders: [\n { name: 'sender', type: 'bytes32' },\n { name: 'recvTime', type: 'uint64' },\n ],\n };\n case 'cancel_orders':\n return {\n Cancellation: [\n { name: 'sender', type: 'bytes32' },\n { name: 'productIds', type: 'uint32[]' },\n { name: 'digests', type: 'bytes32[]' },\n { name: 'nonce', type: 'uint64' },\n ],\n };\n case 'cancel_product_orders':\n return {\n CancellationProducts: [\n { name: 'sender', type: 'bytes32' },\n { name: 'productIds', type: 'uint32[]' },\n { name: 'nonce', type: 'uint64' },\n ],\n };\n case 'liquidate_subaccount':\n return {\n LiquidateSubaccount: [\n { name: 'sender', type: 'bytes32' },\n { name: 'liquidatee', type: 'bytes32' },\n { name: 'mode', type: 'uint8' },\n { name: 'healthGroup', type: 'uint32' },\n { name: 'amount', type: 'int128' },\n { name: 'nonce', type: 'uint64' },\n ],\n };\n case 'link_signer':\n return {\n LinkSigner: [\n { name: 'sender', type: 'bytes32' },\n { name: 'signer', type: 'bytes32' },\n { name: 'nonce', type: 'uint64' },\n ],\n };\n case 'transfer_quote':\n return {\n TransferQuote: [\n { name: 'sender', type: 'bytes32' },\n { name: 'recipient', type: 'bytes32' },\n { name: 'amount', type: 'uint128' },\n { name: 'nonce', type: 'uint64' },\n ],\n };\n case 'leaderboard_authentication':\n return {\n LeaderboardAuthentication: [\n { name: 'sender', type: 'bytes32' },\n { name: 'expiration', type: 'uint64' },\n ],\n };\n case 'mint_nlp':\n return {\n MintNlp: [\n { name: 'sender', type: 'bytes32' },\n { name: 'quoteAmount', type: 'uint128' },\n { name: 'nonce', type: 'uint64' },\n ],\n };\n case 'burn_nlp':\n return {\n BurnNlp: [\n { name: 'sender', type: 'bytes32' },\n { name: 'nlpAmount', type: 'uint128' },\n { name: 'nonce', type: 'uint64' },\n ],\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,SAAS,mBACd,aACuC;AACvC,UAAQ,aAAa;AAAA,IACnB,KAAK;AACH,aAAO;AAAA,QACL,oBAAoB;AAAA,UAClB,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,aAAa,MAAM,SAAS;AAAA,UACpC,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,SAAS,MAAM,SAAS;AAAA,QAClC;AAAA,MACF;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,OAAO;AAAA,UACL,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,YAAY,MAAM,SAAS;AAAA,UACnC,EAAE,MAAM,UAAU,MAAM,SAAS;AAAA,UACjC,EAAE,MAAM,cAAc,MAAM,SAAS;AAAA,UACrC,EAAE,MAAM,SAAS,MAAM,SAAS;AAAA,UAChC,EAAE,MAAM,YAAY,MAAM,UAAU;AAAA,QACtC;AAAA,MACF;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,mBAAmB;AAAA,UACjB,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,YAAY,MAAM,SAAS;AAAA,QACrC;AAAA,MACF;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,cAAc;AAAA,UACZ,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,cAAc,MAAM,WAAW;AAAA,UACvC,EAAE,MAAM,WAAW,MAAM,YAAY;AAAA,UACrC,EAAE,MAAM,SAAS,MAAM,SAAS;AAAA,QAClC;AAAA,MACF;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,sBAAsB;AAAA,UACpB,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,cAAc,MAAM,WAAW;AAAA,UACvC,EAAE,MAAM,SAAS,MAAM,SAAS;AAAA,QAClC;AAAA,MACF;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,qBAAqB;AAAA,UACnB,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,cAAc,MAAM,UAAU;AAAA,UACtC,EAAE,MAAM,QAAQ,MAAM,QAAQ;AAAA,UAC9B,EAAE,MAAM,eAAe,MAAM,SAAS;AAAA,UACtC,EAAE,MAAM,UAAU,MAAM,SAAS;AAAA,UACjC,EAAE,MAAM,SAAS,MAAM,SAAS;AAAA,QAClC;AAAA,MACF;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,YAAY;AAAA,UACV,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,SAAS,MAAM,SAAS;AAAA,QAClC;AAAA,MACF;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,eAAe;AAAA,UACb,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,aAAa,MAAM,UAAU;AAAA,UACrC,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,SAAS,MAAM,SAAS;AAAA,QAClC;AAAA,MACF;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,2BAA2B;AAAA,UACzB,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,cAAc,MAAM,SAAS;AAAA,QACvC;AAAA,MACF;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,SAAS;AAAA,UACP,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,eAAe,MAAM,UAAU;AAAA,UACvC,EAAE,MAAM,SAAS,MAAM,SAAS;AAAA,QAClC;AAAA,MACF;AAAA,IACF,KAAK;AACH,aAAO;AAAA,QACL,SAAS;AAAA,UACP,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,UAClC,EAAE,MAAM,aAAa,MAAM,UAAU;AAAA,UACrC,EAAE,MAAM,SAAS,MAAM,SAAS;AAAA,QAClC;AAAA,MACF;AAAA,EACJ;AACF;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SignableRequestType } from './signableRequestType.cjs';
|
|
2
|
+
import './signatureParamTypes.cjs';
|
|
3
|
+
import 'viem';
|
|
4
|
+
import '../types/subaccountTypes.cjs';
|
|
5
|
+
import '../types/bytes.cjs';
|
|
6
|
+
import '../utils/math/bigDecimal.cjs';
|
|
7
|
+
import 'bignumber.js';
|
|
8
|
+
|
|
9
|
+
interface TypedDataField {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Return the EIP712 types for a given request
|
|
15
|
+
*
|
|
16
|
+
* @param requestType
|
|
17
|
+
*/
|
|
18
|
+
declare function getNadoEIP712Types(requestType: SignableRequestType): Record<string, Array<TypedDataField>>;
|
|
19
|
+
|
|
20
|
+
export { getNadoEIP712Types };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SignableRequestType } from './signableRequestType.js';
|
|
2
|
+
import './signatureParamTypes.js';
|
|
3
|
+
import 'viem';
|
|
4
|
+
import '../types/subaccountTypes.js';
|
|
5
|
+
import '../types/bytes.js';
|
|
6
|
+
import '../utils/math/bigDecimal.js';
|
|
7
|
+
import 'bignumber.js';
|
|
8
|
+
|
|
9
|
+
interface TypedDataField {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Return the EIP712 types for a given request
|
|
15
|
+
*
|
|
16
|
+
* @param requestType
|
|
17
|
+
*/
|
|
18
|
+
declare function getNadoEIP712Types(requestType: SignableRequestType): Record<string, Array<TypedDataField>>;
|
|
19
|
+
|
|
20
|
+
export { getNadoEIP712Types };
|