@nadohq/shared 0.1.0-alpha.4 → 0.1.0-alpha.41
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/dist/abis/index.cjs +12 -12
- package/dist/abis/index.cjs.map +1 -1
- package/dist/abis/index.d.cts +6 -6
- package/dist/abis/index.d.ts +6 -6
- package/dist/abis/index.js +6 -6
- package/dist/abis/index.js.map +1 -1
- package/dist/consts/chainEnvToChain.cjs +2 -2
- package/dist/consts/chainEnvToChain.cjs.map +1 -1
- package/dist/consts/chainEnvToChain.d.cts +329 -39
- package/dist/consts/chainEnvToChain.d.ts +329 -39
- package/dist/consts/chainEnvToChain.js +3 -3
- package/dist/consts/chainEnvToChain.js.map +1 -1
- package/dist/consts/productIds.cjs +1 -1
- package/dist/consts/productIds.cjs.map +1 -1
- package/dist/consts/productIds.d.cts +1 -1
- package/dist/consts/productIds.d.ts +1 -1
- package/dist/consts/productIds.js +1 -1
- package/dist/consts/productIds.js.map +1 -1
- package/dist/deployments/core/deployment.inkMainnet.json +13 -0
- package/dist/deployments/core/deployment.inkSepolia.json +13 -0
- package/dist/deployments/index.cjs +6 -6
- package/dist/deployments/index.cjs.map +1 -1
- package/dist/deployments/index.js +5 -5
- package/dist/deployments/index.js.map +1 -1
- package/dist/eip712/eip712ValueTypes.d.cts +1 -1
- package/dist/eip712/eip712ValueTypes.d.ts +1 -1
- package/dist/eip712/getNadoEIP712Domain.cjs.map +1 -1
- package/dist/eip712/getNadoEIP712Domain.js.map +1 -1
- package/dist/eip712/index.cjs +13 -13
- package/dist/eip712/index.cjs.map +1 -1
- package/dist/eip712/index.d.cts +9 -9
- package/dist/eip712/index.d.ts +9 -9
- package/dist/eip712/index.js +6 -6
- package/dist/eip712/index.js.map +1 -1
- package/dist/index.d.cts +33 -33
- package/dist/index.d.ts +33 -33
- package/dist/types/ChainEnv.cjs +1 -1
- package/dist/types/ChainEnv.cjs.map +1 -1
- package/dist/types/ChainEnv.d.cts +2 -2
- package/dist/types/ChainEnv.d.ts +2 -2
- package/dist/types/ChainEnv.js +1 -1
- package/dist/types/ChainEnv.js.map +1 -1
- package/dist/types/index.cjs +7 -7
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +3 -3
- package/dist/types/index.js.map +1 -1
- package/dist/types/orderAppendixTypes.cjs.map +1 -1
- package/dist/types/orderAppendixTypes.d.cts +7 -3
- package/dist/types/orderAppendixTypes.d.ts +7 -3
- package/dist/utils/createDeterministicLinkedSignerPrivateKey.cjs.map +1 -1
- package/dist/utils/createDeterministicLinkedSignerPrivateKey.js.map +1 -1
- package/dist/utils/index.cjs +12 -12
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +21 -21
- package/dist/utils/index.d.ts +21 -21
- package/dist/utils/index.js +6 -6
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/math/index.cjs +8 -8
- package/dist/utils/math/index.cjs.map +1 -1
- package/dist/utils/math/index.d.cts +4 -4
- package/dist/utils/math/index.d.ts +4 -4
- package/dist/utils/math/index.js +4 -4
- package/dist/utils/math/index.js.map +1 -1
- package/dist/utils/orders/appendix/appendixIsolatedValue.cjs +50 -0
- package/dist/utils/orders/appendix/appendixIsolatedValue.cjs.map +1 -0
- package/dist/utils/orders/appendix/appendixIsolatedValue.d.cts +26 -0
- package/dist/utils/orders/appendix/appendixIsolatedValue.d.ts +26 -0
- package/dist/utils/orders/appendix/appendixIsolatedValue.js +31 -0
- package/dist/utils/orders/appendix/appendixIsolatedValue.js.map +1 -0
- package/dist/utils/orders/appendix/{appendixTWAPValue.cjs → appendixTwapValue.cjs} +14 -15
- package/dist/utils/orders/appendix/appendixTwapValue.cjs.map +1 -0
- package/dist/utils/orders/appendix/appendixTwapValue.d.cts +29 -0
- package/dist/utils/orders/appendix/appendixTwapValue.d.ts +29 -0
- package/dist/utils/orders/appendix/appendixTwapValue.js +25 -0
- package/dist/utils/orders/appendix/appendixTwapValue.js.map +1 -0
- package/dist/utils/orders/appendix/index.cjs +6 -6
- package/dist/utils/orders/appendix/index.cjs.map +1 -1
- package/dist/utils/orders/appendix/index.d.cts +3 -3
- package/dist/utils/orders/appendix/index.d.ts +3 -3
- package/dist/utils/orders/appendix/index.js +3 -3
- package/dist/utils/orders/appendix/index.js.map +1 -1
- package/dist/utils/orders/appendix/orderAppendix.test.cjs +11 -12
- package/dist/utils/orders/appendix/orderAppendix.test.cjs.map +1 -1
- package/dist/utils/orders/appendix/orderAppendix.test.js +11 -12
- package/dist/utils/orders/appendix/orderAppendix.test.js.map +1 -1
- package/dist/utils/orders/appendix/packOrderAppendix.cjs +7 -7
- package/dist/utils/orders/appendix/packOrderAppendix.cjs.map +1 -1
- package/dist/utils/orders/appendix/packOrderAppendix.js +7 -7
- package/dist/utils/orders/appendix/packOrderAppendix.js.map +1 -1
- package/dist/utils/orders/appendix/types.cjs.map +1 -1
- package/dist/utils/orders/appendix/types.d.cts +2 -2
- package/dist/utils/orders/appendix/types.d.ts +2 -2
- package/dist/utils/orders/appendix/unpackOrderAppendix.cjs +7 -6
- package/dist/utils/orders/appendix/unpackOrderAppendix.cjs.map +1 -1
- package/dist/utils/orders/appendix/unpackOrderAppendix.js +7 -6
- package/dist/utils/orders/appendix/unpackOrderAppendix.js.map +1 -1
- package/dist/utils/orders/index.cjs +3 -3
- package/dist/utils/orders/index.cjs.map +1 -1
- package/dist/utils/orders/index.d.cts +5 -5
- package/dist/utils/orders/index.d.ts +5 -5
- package/dist/utils/orders/index.js +1 -1
- package/dist/utils/orders/index.js.map +1 -1
- package/dist/utils/productTypeFilter.cjs.map +1 -1
- package/dist/utils/productTypeFilter.js.map +1 -1
- package/package.json +6 -2
- package/src/abis/index.ts +6 -6
- package/src/consts/chainEnvToChain.ts +2 -2
- package/src/consts/productIds.ts +1 -1
- package/src/deployments/core/deployment.inkMainnet.json +13 -0
- package/src/deployments/core/deployment.inkSepolia.json +13 -0
- package/src/deployments/index.ts +5 -5
- package/src/eip712/getNadoEIP712Domain.ts +1 -1
- package/src/eip712/index.ts +6 -6
- package/src/types/ChainEnv.ts +1 -1
- package/src/types/index.ts +3 -3
- package/src/types/orderAppendixTypes.ts +6 -2
- package/src/utils/createDeterministicLinkedSignerPrivateKey.ts +1 -1
- package/src/utils/index.ts +6 -6
- package/src/utils/math/index.ts +4 -4
- package/src/utils/orders/appendix/appendixIsolatedValue.ts +49 -0
- package/src/utils/orders/appendix/appendixTwapValue.ts +46 -0
- package/src/utils/orders/appendix/index.ts +3 -3
- package/src/utils/orders/appendix/orderAppendix.test.ts +10 -11
- package/src/utils/orders/appendix/packOrderAppendix.ts +8 -8
- package/src/utils/orders/appendix/types.ts +5 -5
- package/src/utils/orders/appendix/unpackOrderAppendix.ts +8 -7
- package/src/utils/orders/index.ts +1 -1
- package/src/utils/productTypeFilter.ts +2 -2
- package/dist/deployments/core/deployment.InkSepolia.json +0 -13
- package/dist/deployments/core/deployment.arbitrumOne.json +0 -18
- package/dist/utils/orders/appendix/appendixTWAPValue.cjs.map +0 -1
- package/dist/utils/orders/appendix/appendixTWAPValue.d.cts +0 -31
- package/dist/utils/orders/appendix/appendixTWAPValue.d.ts +0 -31
- package/dist/utils/orders/appendix/appendixTWAPValue.js +0 -26
- package/dist/utils/orders/appendix/appendixTWAPValue.js.map +0 -1
- package/src/deployments/core/deployment.InkSepolia.json +0 -13
- package/src/deployments/core/deployment.arbitrumOne.json +0 -18
- package/src/utils/orders/appendix/appendixTWAPValue.ts +0 -51
package/dist/eip712/index.cjs
CHANGED
|
@@ -17,27 +17,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
17
17
|
// src/eip712/index.ts
|
|
18
18
|
var eip712_exports = {};
|
|
19
19
|
module.exports = __toCommonJS(eip712_exports);
|
|
20
|
-
__reExport(eip712_exports, require("./
|
|
21
|
-
__reExport(eip712_exports, require("./getNadoEIP712Values.cjs"), module.exports);
|
|
22
|
-
__reExport(eip712_exports, require("./getNadoEIP712Types.cjs"), module.exports);
|
|
23
|
-
__reExport(eip712_exports, require("./getNadoEIP712PrimaryType.cjs"), module.exports);
|
|
20
|
+
__reExport(eip712_exports, require("./eip712ValueTypes.cjs"), module.exports);
|
|
24
21
|
__reExport(eip712_exports, require("./getNadoEIP712Domain.cjs"), module.exports);
|
|
22
|
+
__reExport(eip712_exports, require("./getNadoEIP712PrimaryType.cjs"), module.exports);
|
|
23
|
+
__reExport(eip712_exports, require("./getNadoEIP712Types.cjs"), module.exports);
|
|
24
|
+
__reExport(eip712_exports, require("./getNadoEIP712Values.cjs"), module.exports);
|
|
25
|
+
__reExport(eip712_exports, require("./getOrderVerifyingAddress.cjs"), module.exports);
|
|
26
|
+
__reExport(eip712_exports, require("./getSignedTransactionRequest.cjs"), module.exports);
|
|
25
27
|
__reExport(eip712_exports, require("./orderDigest.cjs"), module.exports);
|
|
26
28
|
__reExport(eip712_exports, require("./signableRequestType.cjs"), module.exports);
|
|
27
29
|
__reExport(eip712_exports, require("./signatureParamTypes.cjs"), module.exports);
|
|
28
|
-
__reExport(eip712_exports, require("./eip712ValueTypes.cjs"), module.exports);
|
|
29
|
-
__reExport(eip712_exports, require("./getOrderVerifyingAddress.cjs"), module.exports);
|
|
30
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
31
|
0 && (module.exports = {
|
|
32
|
-
...require("./
|
|
33
|
-
...require("./getNadoEIP712Values.cjs"),
|
|
34
|
-
...require("./getNadoEIP712Types.cjs"),
|
|
35
|
-
...require("./getNadoEIP712PrimaryType.cjs"),
|
|
32
|
+
...require("./eip712ValueTypes.cjs"),
|
|
36
33
|
...require("./getNadoEIP712Domain.cjs"),
|
|
34
|
+
...require("./getNadoEIP712PrimaryType.cjs"),
|
|
35
|
+
...require("./getNadoEIP712Types.cjs"),
|
|
36
|
+
...require("./getNadoEIP712Values.cjs"),
|
|
37
|
+
...require("./getOrderVerifyingAddress.cjs"),
|
|
38
|
+
...require("./getSignedTransactionRequest.cjs"),
|
|
37
39
|
...require("./orderDigest.cjs"),
|
|
38
40
|
...require("./signableRequestType.cjs"),
|
|
39
|
-
...require("./signatureParamTypes.cjs")
|
|
40
|
-
...require("./eip712ValueTypes.cjs"),
|
|
41
|
-
...require("./getOrderVerifyingAddress.cjs")
|
|
41
|
+
...require("./signatureParamTypes.cjs")
|
|
42
42
|
});
|
|
43
43
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/eip712/index.ts"],"sourcesContent":["export * from './
|
|
1
|
+
{"version":3,"sources":["../../src/eip712/index.ts"],"sourcesContent":["export * from './eip712ValueTypes';\nexport * from './getNadoEIP712Domain';\nexport * from './getNadoEIP712PrimaryType';\nexport * from './getNadoEIP712Types';\nexport * from './getNadoEIP712Values';\nexport * from './getOrderVerifyingAddress';\nexport * from './getSignedTransactionRequest';\nexport * from './orderDigest';\nexport * from './signableRequestType';\nexport * from './signatureParamTypes';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,mCAAd;AACA,2BAAc,sCADd;AAEA,2BAAc,2CAFd;AAGA,2BAAc,qCAHd;AAIA,2BAAc,sCAJd;AAKA,2BAAc,2CALd;AAMA,2BAAc,8CANd;AAOA,2BAAc,8BAPd;AAQA,2BAAc,sCARd;AASA,2BAAc,sCATd;","names":[]}
|
package/dist/eip712/index.d.cts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { getNadoEIP712Values } from './getNadoEIP712Values.cjs';
|
|
3
|
-
export { getNadoEIP712Types } from './getNadoEIP712Types.cjs';
|
|
4
|
-
export { getNadoEIP712PrimaryType } from './getNadoEIP712PrimaryType.cjs';
|
|
1
|
+
export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712ValueTypes.cjs';
|
|
5
2
|
export { getNadoEIP712Domain } from './getNadoEIP712Domain.cjs';
|
|
3
|
+
export { getNadoEIP712PrimaryType } from './getNadoEIP712PrimaryType.cjs';
|
|
4
|
+
export { getNadoEIP712Types } from './getNadoEIP712Types.cjs';
|
|
5
|
+
export { getNadoEIP712Values } from './getNadoEIP712Values.cjs';
|
|
6
|
+
export { getOrderVerifyingAddress } from './getOrderVerifyingAddress.cjs';
|
|
7
|
+
export { getSignedTransactionRequest } from './getSignedTransactionRequest.cjs';
|
|
6
8
|
export { getOrderDigest } from './orderDigest.cjs';
|
|
7
9
|
export { SignableRequestType, SignableRequestTypeToParams } from './signableRequestType.cjs';
|
|
8
10
|
export { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712OrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams, SignedEIP712OrderParams, SignedTx } from './signatureParamTypes.cjs';
|
|
9
|
-
export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712ValueTypes.cjs';
|
|
10
|
-
export { getOrderVerifyingAddress } from './getOrderVerifyingAddress.cjs';
|
|
11
|
-
import '../types/viemTypes.cjs';
|
|
12
11
|
import 'viem';
|
|
12
|
+
import '../utils/math/bigDecimal.cjs';
|
|
13
|
+
import 'bignumber.js';
|
|
13
14
|
import 'abitype';
|
|
15
|
+
import '../types/viemTypes.cjs';
|
|
14
16
|
import '../types/subaccountTypes.cjs';
|
|
15
17
|
import '../types/bytes.cjs';
|
|
16
|
-
import '../utils/math/bigDecimal.cjs';
|
|
17
|
-
import 'bignumber.js';
|
package/dist/eip712/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { getNadoEIP712Values } from './getNadoEIP712Values.js';
|
|
3
|
-
export { getNadoEIP712Types } from './getNadoEIP712Types.js';
|
|
4
|
-
export { getNadoEIP712PrimaryType } from './getNadoEIP712PrimaryType.js';
|
|
1
|
+
export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712ValueTypes.js';
|
|
5
2
|
export { getNadoEIP712Domain } from './getNadoEIP712Domain.js';
|
|
3
|
+
export { getNadoEIP712PrimaryType } from './getNadoEIP712PrimaryType.js';
|
|
4
|
+
export { getNadoEIP712Types } from './getNadoEIP712Types.js';
|
|
5
|
+
export { getNadoEIP712Values } from './getNadoEIP712Values.js';
|
|
6
|
+
export { getOrderVerifyingAddress } from './getOrderVerifyingAddress.js';
|
|
7
|
+
export { getSignedTransactionRequest } from './getSignedTransactionRequest.js';
|
|
6
8
|
export { getOrderDigest } from './orderDigest.js';
|
|
7
9
|
export { SignableRequestType, SignableRequestTypeToParams } from './signableRequestType.js';
|
|
8
10
|
export { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712OrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams, SignedEIP712OrderParams, SignedTx } from './signatureParamTypes.js';
|
|
9
|
-
export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712ValueTypes.js';
|
|
10
|
-
export { getOrderVerifyingAddress } from './getOrderVerifyingAddress.js';
|
|
11
|
-
import '../types/viemTypes.js';
|
|
12
11
|
import 'viem';
|
|
12
|
+
import '../utils/math/bigDecimal.js';
|
|
13
|
+
import 'bignumber.js';
|
|
13
14
|
import 'abitype';
|
|
15
|
+
import '../types/viemTypes.js';
|
|
14
16
|
import '../types/subaccountTypes.js';
|
|
15
17
|
import '../types/bytes.js';
|
|
16
|
-
import '../utils/math/bigDecimal.js';
|
|
17
|
-
import 'bignumber.js';
|
package/dist/eip712/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// src/eip712/index.ts
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./getNadoEIP712Values.js";
|
|
4
|
-
export * from "./getNadoEIP712Types.js";
|
|
5
|
-
export * from "./getNadoEIP712PrimaryType.js";
|
|
2
|
+
export * from "./eip712ValueTypes.js";
|
|
6
3
|
export * from "./getNadoEIP712Domain.js";
|
|
4
|
+
export * from "./getNadoEIP712PrimaryType.js";
|
|
5
|
+
export * from "./getNadoEIP712Types.js";
|
|
6
|
+
export * from "./getNadoEIP712Values.js";
|
|
7
|
+
export * from "./getOrderVerifyingAddress.js";
|
|
8
|
+
export * from "./getSignedTransactionRequest.js";
|
|
7
9
|
export * from "./orderDigest.js";
|
|
8
10
|
export * from "./signableRequestType.js";
|
|
9
11
|
export * from "./signatureParamTypes.js";
|
|
10
|
-
export * from "./eip712ValueTypes.js";
|
|
11
|
-
export * from "./getOrderVerifyingAddress.js";
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/dist/eip712/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/eip712/index.ts"],"sourcesContent":["export * from './
|
|
1
|
+
{"version":3,"sources":["../../src/eip712/index.ts"],"sourcesContent":["export * from './eip712ValueTypes';\nexport * from './getNadoEIP712Domain';\nexport * from './getNadoEIP712PrimaryType';\nexport * from './getNadoEIP712Types';\nexport * from './getNadoEIP712Values';\nexport * from './getOrderVerifyingAddress';\nexport * from './getSignedTransactionRequest';\nexport * from './orderDigest';\nexport * from './signableRequestType';\nexport * from './signatureParamTypes';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
+
export { CLEARINGHOUSE_ABI } from './abis/Clearinghouse.cjs';
|
|
2
|
+
export { ENDPOINT_ABI } from './abis/Endpoint.cjs';
|
|
1
3
|
export { ERC20_ABI } from './abis/ERC20.cjs';
|
|
2
4
|
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
5
|
export { NADO_ABIS, NadoAbis, NadoContractName } from './abis/nadoAbis.cjs';
|
|
6
|
+
export { PERP_ENGINE_ABI } from './abis/PerpEngine.cjs';
|
|
7
|
+
export { QUERIER_ABI } from './abis/Querier.cjs';
|
|
8
|
+
export { SPOT_ENGINE_ABI } from './abis/SpotEngine.cjs';
|
|
9
|
+
export { WITHDRAW_POOL_ABI } from './abis/WithdrawPool.cjs';
|
|
10
10
|
export { CHAIN_ENV_TO_CHAIN, CHAIN_ID_TO_CHAIN_ENV } from './consts/chainEnvToChain.cjs';
|
|
11
11
|
export { NLP_PRODUCT_ID, QUOTE_PRODUCT_ID } from './consts/productIds.cjs';
|
|
12
12
|
export { NADO_DEPLOYMENTS, NadoDeploymentAddresses } from './deployments/index.cjs';
|
|
13
|
-
export {
|
|
14
|
-
export { getNadoEIP712Values } from './eip712/getNadoEIP712Values.cjs';
|
|
15
|
-
export { getNadoEIP712Types } from './eip712/getNadoEIP712Types.cjs';
|
|
16
|
-
export { getNadoEIP712PrimaryType } from './eip712/getNadoEIP712PrimaryType.cjs';
|
|
13
|
+
export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712/eip712ValueTypes.cjs';
|
|
17
14
|
export { getNadoEIP712Domain } from './eip712/getNadoEIP712Domain.cjs';
|
|
15
|
+
export { getNadoEIP712PrimaryType } from './eip712/getNadoEIP712PrimaryType.cjs';
|
|
16
|
+
export { getNadoEIP712Types } from './eip712/getNadoEIP712Types.cjs';
|
|
17
|
+
export { getNadoEIP712Values } from './eip712/getNadoEIP712Values.cjs';
|
|
18
|
+
export { getOrderVerifyingAddress } from './eip712/getOrderVerifyingAddress.cjs';
|
|
19
|
+
export { getSignedTransactionRequest } from './eip712/getSignedTransactionRequest.cjs';
|
|
18
20
|
export { getOrderDigest } from './eip712/orderDigest.cjs';
|
|
19
21
|
export { SignableRequestType, SignableRequestTypeToParams } from './eip712/signableRequestType.cjs';
|
|
20
22
|
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
23
|
export { encodeSignedOrder, encodeSignedWithdrawCollateralTx } from './encoding/encoding.cjs';
|
|
24
24
|
export { ApproveDepositAllowanceParams, approveDepositAllowance } from './execute/approveDepositAllowance.cjs';
|
|
25
25
|
export { DepositCollateralParams, depositCollateral } from './execute/depositCollateral.cjs';
|
|
@@ -28,37 +28,37 @@ export { Bytes } from './types/bytes.cjs';
|
|
|
28
28
|
export { ALL_CHAIN_ENVS, ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS } from './types/ChainEnv.cjs';
|
|
29
29
|
export { HealthGroup, HealthStatus, HealthStatusByType, HealthType } from './types/healthTypes.cjs';
|
|
30
30
|
export { Market, MarketWithProduct, PerpMarket, SpotMarket } from './types/marketTypes.cjs';
|
|
31
|
+
export { NadoContracts, WithContract, WithContracts } from './types/nadoContractTypes.cjs';
|
|
32
|
+
export { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTriggerType, OrderAppendixTwapFields } from './types/orderAppendixTypes.cjs';
|
|
33
|
+
export { OrderExecutionType } from './types/OrderExecutionType.cjs';
|
|
31
34
|
export { PerpProduct, Product, ProductEngineType, SpotProduct, toProductEngineType } from './types/productTypes.cjs';
|
|
32
35
|
export { Subaccount, SubaccountBytes32, SubaccountNameBytes12 } from './types/subaccountTypes.cjs';
|
|
33
|
-
export { NadoContracts, WithContract, WithContracts } from './types/nadoContractTypes.cjs';
|
|
34
36
|
export { AccountWithPrivateKey, ContractInstance, WalletClientWithAccount, WriteableContractInstance } from './types/viemTypes.cjs';
|
|
35
|
-
export {
|
|
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';
|
|
37
|
+
export { AsyncResult, asyncResult } from './utils/asyncResult.cjs';
|
|
46
38
|
export { calcPerpBalanceNotionalValue, calcPerpBalanceValue, calcSpotBalanceValue } from './utils/balanceValue.cjs';
|
|
47
39
|
export { subaccountFromBytes32, subaccountFromHex, subaccountNameBytesToStr, subaccountNameToBytes12, subaccountToBytes32, subaccountToHex } from './utils/bytes32.cjs';
|
|
48
40
|
export { createDeterministicLinkedSignerPrivateKey } from './utils/createDeterministicLinkedSignerPrivateKey.cjs';
|
|
49
|
-
export { isWriteableContract } from './utils/isWriteableContract.cjs';
|
|
50
41
|
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
42
|
export { getValidatedAddress } from './utils/getValidatedAddress.cjs';
|
|
60
43
|
export { getValidatedHex } from './utils/getValidatedHex.cjs';
|
|
44
|
+
export { calcBorrowRateForTimeRange, calcBorrowRatePerSecond, calcRealizedDepositRateForTimeRange, calcTotalBorrowed, calcTotalDeposited, calcUtilizationRatio } from './utils/interest.cjs';
|
|
45
|
+
export { isWriteableContract } from './utils/isWriteableContract.cjs';
|
|
61
46
|
export { mapValues } from './utils/mapValues.cjs';
|
|
47
|
+
export { BigDecimalish, toBigDecimal } from './utils/math/bigDecimal.cjs';
|
|
48
|
+
export { BigDecimals } from './utils/math/BigDecimals.cjs';
|
|
49
|
+
export { clampBigDecimal } from './utils/math/clamp.cjs';
|
|
50
|
+
export { NADO_PRODUCT_DECIMALS, addDecimals, removeDecimals } from './utils/math/decimalAdjustment.cjs';
|
|
51
|
+
export { sumBigDecimalBy } from './utils/math/sumBigDecimalBy.cjs';
|
|
52
|
+
export { toBigInt } from './utils/math/toBigInt.cjs';
|
|
53
|
+
export { toIntegerString } from './utils/math/toIntegerString.cjs';
|
|
54
|
+
export { packTwapOrderAppendixValue, unpackTwapOrderAppendixValue } from './utils/orders/appendix/appendixTwapValue.cjs';
|
|
55
|
+
export { bitMaskValue } from './utils/orders/appendix/bitMaskValue.cjs';
|
|
56
|
+
export { packOrderAppendix } from './utils/orders/appendix/packOrderAppendix.cjs';
|
|
57
|
+
export { PackedOrderAppendixBits } from './utils/orders/appendix/types.cjs';
|
|
58
|
+
export { unpackOrderAppendix } from './utils/orders/appendix/unpackOrderAppendix.cjs';
|
|
59
|
+
export { getOrderNonce, getRecvTimeFromOrderNonce } from './utils/orders/orderNonce.cjs';
|
|
60
|
+
export { getDefaultRecvTime } from './utils/orders/recvTime.cjs';
|
|
61
|
+
export { isPerpBalance, isPerpProduct, isSpotBalance, isSpotProduct } from './utils/productTypeFilter.cjs';
|
|
62
62
|
export { TimeInSeconds, millisToSeconds, nowInSeconds } from './utils/time.cjs';
|
|
63
63
|
export { toPrintableObject } from './utils/toPrintableObject.cjs';
|
|
64
64
|
export { default as BigDecimal } from 'bignumber.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
+
export { CLEARINGHOUSE_ABI } from './abis/Clearinghouse.js';
|
|
2
|
+
export { ENDPOINT_ABI } from './abis/Endpoint.js';
|
|
1
3
|
export { ERC20_ABI } from './abis/ERC20.js';
|
|
2
4
|
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
5
|
export { NADO_ABIS, NadoAbis, NadoContractName } from './abis/nadoAbis.js';
|
|
6
|
+
export { PERP_ENGINE_ABI } from './abis/PerpEngine.js';
|
|
7
|
+
export { QUERIER_ABI } from './abis/Querier.js';
|
|
8
|
+
export { SPOT_ENGINE_ABI } from './abis/SpotEngine.js';
|
|
9
|
+
export { WITHDRAW_POOL_ABI } from './abis/WithdrawPool.js';
|
|
10
10
|
export { CHAIN_ENV_TO_CHAIN, CHAIN_ID_TO_CHAIN_ENV } from './consts/chainEnvToChain.js';
|
|
11
11
|
export { NLP_PRODUCT_ID, QUOTE_PRODUCT_ID } from './consts/productIds.js';
|
|
12
12
|
export { NADO_DEPLOYMENTS, NadoDeploymentAddresses } from './deployments/index.js';
|
|
13
|
-
export {
|
|
14
|
-
export { getNadoEIP712Values } from './eip712/getNadoEIP712Values.js';
|
|
15
|
-
export { getNadoEIP712Types } from './eip712/getNadoEIP712Types.js';
|
|
16
|
-
export { getNadoEIP712PrimaryType } from './eip712/getNadoEIP712PrimaryType.js';
|
|
13
|
+
export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712/eip712ValueTypes.js';
|
|
17
14
|
export { getNadoEIP712Domain } from './eip712/getNadoEIP712Domain.js';
|
|
15
|
+
export { getNadoEIP712PrimaryType } from './eip712/getNadoEIP712PrimaryType.js';
|
|
16
|
+
export { getNadoEIP712Types } from './eip712/getNadoEIP712Types.js';
|
|
17
|
+
export { getNadoEIP712Values } from './eip712/getNadoEIP712Values.js';
|
|
18
|
+
export { getOrderVerifyingAddress } from './eip712/getOrderVerifyingAddress.js';
|
|
19
|
+
export { getSignedTransactionRequest } from './eip712/getSignedTransactionRequest.js';
|
|
18
20
|
export { getOrderDigest } from './eip712/orderDigest.js';
|
|
19
21
|
export { SignableRequestType, SignableRequestTypeToParams } from './eip712/signableRequestType.js';
|
|
20
22
|
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
23
|
export { encodeSignedOrder, encodeSignedWithdrawCollateralTx } from './encoding/encoding.js';
|
|
24
24
|
export { ApproveDepositAllowanceParams, approveDepositAllowance } from './execute/approveDepositAllowance.js';
|
|
25
25
|
export { DepositCollateralParams, depositCollateral } from './execute/depositCollateral.js';
|
|
@@ -28,37 +28,37 @@ export { Bytes } from './types/bytes.js';
|
|
|
28
28
|
export { ALL_CHAIN_ENVS, ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS } from './types/ChainEnv.js';
|
|
29
29
|
export { HealthGroup, HealthStatus, HealthStatusByType, HealthType } from './types/healthTypes.js';
|
|
30
30
|
export { Market, MarketWithProduct, PerpMarket, SpotMarket } from './types/marketTypes.js';
|
|
31
|
+
export { NadoContracts, WithContract, WithContracts } from './types/nadoContractTypes.js';
|
|
32
|
+
export { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTriggerType, OrderAppendixTwapFields } from './types/orderAppendixTypes.js';
|
|
33
|
+
export { OrderExecutionType } from './types/OrderExecutionType.js';
|
|
31
34
|
export { PerpProduct, Product, ProductEngineType, SpotProduct, toProductEngineType } from './types/productTypes.js';
|
|
32
35
|
export { Subaccount, SubaccountBytes32, SubaccountNameBytes12 } from './types/subaccountTypes.js';
|
|
33
|
-
export { NadoContracts, WithContract, WithContracts } from './types/nadoContractTypes.js';
|
|
34
36
|
export { AccountWithPrivateKey, ContractInstance, WalletClientWithAccount, WriteableContractInstance } from './types/viemTypes.js';
|
|
35
|
-
export {
|
|
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';
|
|
37
|
+
export { AsyncResult, asyncResult } from './utils/asyncResult.js';
|
|
46
38
|
export { calcPerpBalanceNotionalValue, calcPerpBalanceValue, calcSpotBalanceValue } from './utils/balanceValue.js';
|
|
47
39
|
export { subaccountFromBytes32, subaccountFromHex, subaccountNameBytesToStr, subaccountNameToBytes12, subaccountToBytes32, subaccountToHex } from './utils/bytes32.js';
|
|
48
40
|
export { createDeterministicLinkedSignerPrivateKey } from './utils/createDeterministicLinkedSignerPrivateKey.js';
|
|
49
|
-
export { isWriteableContract } from './utils/isWriteableContract.js';
|
|
50
41
|
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
42
|
export { getValidatedAddress } from './utils/getValidatedAddress.js';
|
|
60
43
|
export { getValidatedHex } from './utils/getValidatedHex.js';
|
|
44
|
+
export { calcBorrowRateForTimeRange, calcBorrowRatePerSecond, calcRealizedDepositRateForTimeRange, calcTotalBorrowed, calcTotalDeposited, calcUtilizationRatio } from './utils/interest.js';
|
|
45
|
+
export { isWriteableContract } from './utils/isWriteableContract.js';
|
|
61
46
|
export { mapValues } from './utils/mapValues.js';
|
|
47
|
+
export { BigDecimalish, toBigDecimal } from './utils/math/bigDecimal.js';
|
|
48
|
+
export { BigDecimals } from './utils/math/BigDecimals.js';
|
|
49
|
+
export { clampBigDecimal } from './utils/math/clamp.js';
|
|
50
|
+
export { NADO_PRODUCT_DECIMALS, addDecimals, removeDecimals } from './utils/math/decimalAdjustment.js';
|
|
51
|
+
export { sumBigDecimalBy } from './utils/math/sumBigDecimalBy.js';
|
|
52
|
+
export { toBigInt } from './utils/math/toBigInt.js';
|
|
53
|
+
export { toIntegerString } from './utils/math/toIntegerString.js';
|
|
54
|
+
export { packTwapOrderAppendixValue, unpackTwapOrderAppendixValue } from './utils/orders/appendix/appendixTwapValue.js';
|
|
55
|
+
export { bitMaskValue } from './utils/orders/appendix/bitMaskValue.js';
|
|
56
|
+
export { packOrderAppendix } from './utils/orders/appendix/packOrderAppendix.js';
|
|
57
|
+
export { PackedOrderAppendixBits } from './utils/orders/appendix/types.js';
|
|
58
|
+
export { unpackOrderAppendix } from './utils/orders/appendix/unpackOrderAppendix.js';
|
|
59
|
+
export { getOrderNonce, getRecvTimeFromOrderNonce } from './utils/orders/orderNonce.js';
|
|
60
|
+
export { getDefaultRecvTime } from './utils/orders/recvTime.js';
|
|
61
|
+
export { isPerpBalance, isPerpProduct, isSpotBalance, isSpotProduct } from './utils/productTypeFilter.js';
|
|
62
62
|
export { TimeInSeconds, millisToSeconds, nowInSeconds } from './utils/time.js';
|
|
63
63
|
export { toPrintableObject } from './utils/toPrintableObject.js';
|
|
64
64
|
export { default as BigDecimal } from 'bignumber.js';
|
package/dist/types/ChainEnv.cjs
CHANGED
|
@@ -28,7 +28,7 @@ __export(ChainEnv_exports, {
|
|
|
28
28
|
module.exports = __toCommonJS(ChainEnv_exports);
|
|
29
29
|
var LOCAL_CHAIN_ENVS = ["local"];
|
|
30
30
|
var TESTNET_CHAIN_ENVS = ["inkTestnet"];
|
|
31
|
-
var MAINNET_CHAIN_ENVS = ["
|
|
31
|
+
var MAINNET_CHAIN_ENVS = ["inkMainnet"];
|
|
32
32
|
var ALL_CHAIN_ENVS = [
|
|
33
33
|
...LOCAL_CHAIN_ENVS,
|
|
34
34
|
...TESTNET_CHAIN_ENVS,
|
|
@@ -1 +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 = ['
|
|
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 = ['inkMainnet'] 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,YAAY;AAExC,IAAM,iBAAiB;AAAA,EAC5B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const LOCAL_CHAIN_ENVS: ["local"];
|
|
2
2
|
declare const TESTNET_CHAIN_ENVS: ["inkTestnet"];
|
|
3
|
-
declare const MAINNET_CHAIN_ENVS: ["
|
|
4
|
-
declare const ALL_CHAIN_ENVS: ["local", "inkTestnet", "
|
|
3
|
+
declare const MAINNET_CHAIN_ENVS: ["inkMainnet"];
|
|
4
|
+
declare const ALL_CHAIN_ENVS: ["local", "inkTestnet", "inkMainnet"];
|
|
5
5
|
type ChainEnv = (typeof ALL_CHAIN_ENVS)[number];
|
|
6
6
|
|
|
7
7
|
export { ALL_CHAIN_ENVS, type ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS };
|
package/dist/types/ChainEnv.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const LOCAL_CHAIN_ENVS: ["local"];
|
|
2
2
|
declare const TESTNET_CHAIN_ENVS: ["inkTestnet"];
|
|
3
|
-
declare const MAINNET_CHAIN_ENVS: ["
|
|
4
|
-
declare const ALL_CHAIN_ENVS: ["local", "inkTestnet", "
|
|
3
|
+
declare const MAINNET_CHAIN_ENVS: ["inkMainnet"];
|
|
4
|
+
declare const ALL_CHAIN_ENVS: ["local", "inkTestnet", "inkMainnet"];
|
|
5
5
|
type ChainEnv = (typeof ALL_CHAIN_ENVS)[number];
|
|
6
6
|
|
|
7
7
|
export { ALL_CHAIN_ENVS, type ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS };
|
package/dist/types/ChainEnv.js
CHANGED
|
@@ -3,7 +3,7 @@ import "../chunk-5WRI5ZAA.js";
|
|
|
3
3
|
// src/types/ChainEnv.ts
|
|
4
4
|
var LOCAL_CHAIN_ENVS = ["local"];
|
|
5
5
|
var TESTNET_CHAIN_ENVS = ["inkTestnet"];
|
|
6
|
-
var MAINNET_CHAIN_ENVS = ["
|
|
6
|
+
var MAINNET_CHAIN_ENVS = ["inkMainnet"];
|
|
7
7
|
var ALL_CHAIN_ENVS = [
|
|
8
8
|
...LOCAL_CHAIN_ENVS,
|
|
9
9
|
...TESTNET_CHAIN_ENVS,
|
|
@@ -1 +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 = ['
|
|
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 = ['inkMainnet'] 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,YAAY;AAExC,IAAM,iBAAiB;AAAA,EAC5B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;","names":[]}
|
package/dist/types/index.cjs
CHANGED
|
@@ -22,12 +22,12 @@ __reExport(types_exports, require("./bytes.cjs"), module.exports);
|
|
|
22
22
|
__reExport(types_exports, require("./ChainEnv.cjs"), module.exports);
|
|
23
23
|
__reExport(types_exports, require("./healthTypes.cjs"), module.exports);
|
|
24
24
|
__reExport(types_exports, require("./marketTypes.cjs"), module.exports);
|
|
25
|
+
__reExport(types_exports, require("./nadoContractTypes.cjs"), module.exports);
|
|
26
|
+
__reExport(types_exports, require("./orderAppendixTypes.cjs"), module.exports);
|
|
27
|
+
__reExport(types_exports, require("./OrderExecutionType.cjs"), module.exports);
|
|
25
28
|
__reExport(types_exports, require("./productTypes.cjs"), module.exports);
|
|
26
29
|
__reExport(types_exports, require("./subaccountTypes.cjs"), module.exports);
|
|
27
|
-
__reExport(types_exports, require("./nadoContractTypes.cjs"), module.exports);
|
|
28
30
|
__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
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
32
|
0 && (module.exports = {
|
|
33
33
|
...require("./balanceTypes.cjs"),
|
|
@@ -35,11 +35,11 @@ __reExport(types_exports, require("./orderAppendixTypes.cjs"), module.exports);
|
|
|
35
35
|
...require("./ChainEnv.cjs"),
|
|
36
36
|
...require("./healthTypes.cjs"),
|
|
37
37
|
...require("./marketTypes.cjs"),
|
|
38
|
-
...require("./productTypes.cjs"),
|
|
39
|
-
...require("./subaccountTypes.cjs"),
|
|
40
38
|
...require("./nadoContractTypes.cjs"),
|
|
41
|
-
...require("./
|
|
39
|
+
...require("./orderAppendixTypes.cjs"),
|
|
42
40
|
...require("./OrderExecutionType.cjs"),
|
|
43
|
-
...require("./
|
|
41
|
+
...require("./productTypes.cjs"),
|
|
42
|
+
...require("./subaccountTypes.cjs"),
|
|
43
|
+
...require("./viemTypes.cjs")
|
|
44
44
|
});
|
|
45
45
|
//# sourceMappingURL=index.cjs.map
|
package/dist/types/index.cjs.map
CHANGED
|
@@ -1 +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 './
|
|
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 './nadoContractTypes';\nexport * from './orderAppendixTypes';\nexport * from './OrderExecutionType';\nexport * from './productTypes';\nexport * from './subaccountTypes';\nexport * from './viemTypes';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,+BAAd;AACA,0BAAc,wBADd;AAEA,0BAAc,2BAFd;AAGA,0BAAc,8BAHd;AAIA,0BAAc,8BAJd;AAKA,0BAAc,oCALd;AAMA,0BAAc,qCANd;AAOA,0BAAc,qCAPd;AAQA,0BAAc,+BARd;AASA,0BAAc,kCATd;AAUA,0BAAc,4BAVd;","names":[]}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -3,13 +3,13 @@ export { Bytes } from './bytes.cjs';
|
|
|
3
3
|
export { ALL_CHAIN_ENVS, ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS } from './ChainEnv.cjs';
|
|
4
4
|
export { HealthGroup, HealthStatus, HealthStatusByType, HealthType } from './healthTypes.cjs';
|
|
5
5
|
export { Market, MarketWithProduct, PerpMarket, SpotMarket } from './marketTypes.cjs';
|
|
6
|
+
export { NadoContracts, WithContract, WithContracts } from './nadoContractTypes.cjs';
|
|
7
|
+
export { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTriggerType, OrderAppendixTwapFields } from './orderAppendixTypes.cjs';
|
|
8
|
+
export { OrderExecutionType } from './OrderExecutionType.cjs';
|
|
6
9
|
export { PerpProduct, Product, ProductEngineType, SpotProduct, toProductEngineType } from './productTypes.cjs';
|
|
7
10
|
export { Subaccount, SubaccountBytes32, SubaccountNameBytes12 } from './subaccountTypes.cjs';
|
|
8
|
-
export { NadoContracts, WithContract, WithContracts } from './nadoContractTypes.cjs';
|
|
9
11
|
export { AccountWithPrivateKey, ContractInstance, WalletClientWithAccount, WriteableContractInstance } from './viemTypes.cjs';
|
|
10
|
-
export { OrderExecutionType } from './OrderExecutionType.cjs';
|
|
11
|
-
export { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTWAPFields, OrderAppendixTriggerType } from './orderAppendixTypes.cjs';
|
|
12
12
|
import 'bignumber.js';
|
|
13
13
|
import '../abis/nadoAbis.cjs';
|
|
14
|
-
import 'viem';
|
|
15
14
|
import '../utils/math/bigDecimal.cjs';
|
|
15
|
+
import 'viem';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ export { Bytes } from './bytes.js';
|
|
|
3
3
|
export { ALL_CHAIN_ENVS, ChainEnv, LOCAL_CHAIN_ENVS, MAINNET_CHAIN_ENVS, TESTNET_CHAIN_ENVS } from './ChainEnv.js';
|
|
4
4
|
export { HealthGroup, HealthStatus, HealthStatusByType, HealthType } from './healthTypes.js';
|
|
5
5
|
export { Market, MarketWithProduct, PerpMarket, SpotMarket } from './marketTypes.js';
|
|
6
|
+
export { NadoContracts, WithContract, WithContracts } from './nadoContractTypes.js';
|
|
7
|
+
export { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTriggerType, OrderAppendixTwapFields } from './orderAppendixTypes.js';
|
|
8
|
+
export { OrderExecutionType } from './OrderExecutionType.js';
|
|
6
9
|
export { PerpProduct, Product, ProductEngineType, SpotProduct, toProductEngineType } from './productTypes.js';
|
|
7
10
|
export { Subaccount, SubaccountBytes32, SubaccountNameBytes12 } from './subaccountTypes.js';
|
|
8
|
-
export { NadoContracts, WithContract, WithContracts } from './nadoContractTypes.js';
|
|
9
11
|
export { AccountWithPrivateKey, ContractInstance, WalletClientWithAccount, WriteableContractInstance } from './viemTypes.js';
|
|
10
|
-
export { OrderExecutionType } from './OrderExecutionType.js';
|
|
11
|
-
export { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTWAPFields, OrderAppendixTriggerType } from './orderAppendixTypes.js';
|
|
12
12
|
import 'bignumber.js';
|
|
13
13
|
import '../abis/nadoAbis.js';
|
|
14
|
-
import 'viem';
|
|
15
14
|
import '../utils/math/bigDecimal.js';
|
|
15
|
+
import 'viem';
|
package/dist/types/index.js
CHANGED
|
@@ -4,10 +4,10 @@ export * from "./bytes.js";
|
|
|
4
4
|
export * from "./ChainEnv.js";
|
|
5
5
|
export * from "./healthTypes.js";
|
|
6
6
|
export * from "./marketTypes.js";
|
|
7
|
+
export * from "./nadoContractTypes.js";
|
|
8
|
+
export * from "./orderAppendixTypes.js";
|
|
9
|
+
export * from "./OrderExecutionType.js";
|
|
7
10
|
export * from "./productTypes.js";
|
|
8
11
|
export * from "./subaccountTypes.js";
|
|
9
|
-
export * from "./nadoContractTypes.js";
|
|
10
12
|
export * from "./viemTypes.js";
|
|
11
|
-
export * from "./OrderExecutionType.js";
|
|
12
|
-
export * from "./orderAppendixTypes.js";
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +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 './
|
|
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 './nadoContractTypes';\nexport * from './orderAppendixTypes';\nexport * from './OrderExecutionType';\nexport * from './productTypes';\nexport * from './subaccountTypes';\nexport * from './viemTypes';\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":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/orderAppendixTypes.ts"],"sourcesContent":["import { BigDecimalish } from '../utils/math';\nimport { OrderExecutionType } from './OrderExecutionType';\n\n/**\n * Encodes whether the order will be sent to the trigger service\n */\nexport type OrderAppendixTriggerType =\n | 'price'\n | 'twap'\n // TWAP with specified order amounts, which will be specified in the Trigger Order itself\n | 'twap_custom_amounts';\n\n/**\n * Fields associated with a TWAP trigger order.\n */\nexport interface
|
|
1
|
+
{"version":3,"sources":["../../src/types/orderAppendixTypes.ts"],"sourcesContent":["import { BigDecimalish } from '../utils/math';\nimport { OrderExecutionType } from './OrderExecutionType';\n\n/**\n * Encodes whether the order will be sent to the trigger service\n */\nexport type OrderAppendixTriggerType =\n | 'price'\n | 'twap'\n // TWAP with specified order amounts, which will be specified in the Trigger Order itself\n | 'twap_custom_amounts';\n\n/**\n * Fields associated with a TWAP trigger order.\n */\nexport interface OrderAppendixTwapFields {\n /**\n * Number of TWAP orders to be placed.\n */\n numOrders: number;\n /**\n * Maximum slippage on each TWAP order, based on the oracle price at time of order execution.\n * Ex: 0.01 means 1% slippage.\n */\n slippageFrac: number;\n}\n\n/**\n * Fields associated with an isolated order\n */\nexport interface OrderAppendixIsolatedFields {\n /**\n * Amount of margin to transfer into the isolated position.\n *\n * Implementation Note:\n * Packed appendix uses precision of 6 decimals on backend.\n * SDK automatically converts to/from x18 during packing/unpacking.\n */\n margin: BigDecimalish;\n}\n\n/**\n * All the fields encoded by the order appendix\n */\nexport interface OrderAppendix {\n reduceOnly?: boolean;\n orderExecutionType: OrderExecutionType;\n /**\n * Specify the type of trigger that will be used for the order if the order will be sent to the trigger service.\n */\n triggerType?: OrderAppendixTriggerType;\n /**\n * Specify if the order is for an isolated position\n * An order CANNOT be both a TWAP order and an isolated order.\n */\n isolated?: OrderAppendixIsolatedFields;\n /**\n * Specify if the order is a TWAP order\n * An order CANNOT be both a TWAP order and an isolated order.\n */\n twap?: OrderAppendixTwapFields;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -9,7 +9,7 @@ type OrderAppendixTriggerType = 'price' | 'twap' | 'twap_custom_amounts';
|
|
|
9
9
|
/**
|
|
10
10
|
* Fields associated with a TWAP trigger order.
|
|
11
11
|
*/
|
|
12
|
-
interface
|
|
12
|
+
interface OrderAppendixTwapFields {
|
|
13
13
|
/**
|
|
14
14
|
* Number of TWAP orders to be placed.
|
|
15
15
|
*/
|
|
@@ -26,6 +26,10 @@ interface OrderAppendixTWAPFields {
|
|
|
26
26
|
interface OrderAppendixIsolatedFields {
|
|
27
27
|
/**
|
|
28
28
|
* Amount of margin to transfer into the isolated position.
|
|
29
|
+
*
|
|
30
|
+
* Implementation Note:
|
|
31
|
+
* Packed appendix uses precision of 6 decimals on backend.
|
|
32
|
+
* SDK automatically converts to/from x18 during packing/unpacking.
|
|
29
33
|
*/
|
|
30
34
|
margin: BigDecimalish;
|
|
31
35
|
}
|
|
@@ -48,7 +52,7 @@ interface OrderAppendix {
|
|
|
48
52
|
* Specify if the order is a TWAP order
|
|
49
53
|
* An order CANNOT be both a TWAP order and an isolated order.
|
|
50
54
|
*/
|
|
51
|
-
twap?:
|
|
55
|
+
twap?: OrderAppendixTwapFields;
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
export type { OrderAppendix, OrderAppendixIsolatedFields,
|
|
58
|
+
export type { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTriggerType, OrderAppendixTwapFields };
|
|
@@ -9,7 +9,7 @@ type OrderAppendixTriggerType = 'price' | 'twap' | 'twap_custom_amounts';
|
|
|
9
9
|
/**
|
|
10
10
|
* Fields associated with a TWAP trigger order.
|
|
11
11
|
*/
|
|
12
|
-
interface
|
|
12
|
+
interface OrderAppendixTwapFields {
|
|
13
13
|
/**
|
|
14
14
|
* Number of TWAP orders to be placed.
|
|
15
15
|
*/
|
|
@@ -26,6 +26,10 @@ interface OrderAppendixTWAPFields {
|
|
|
26
26
|
interface OrderAppendixIsolatedFields {
|
|
27
27
|
/**
|
|
28
28
|
* Amount of margin to transfer into the isolated position.
|
|
29
|
+
*
|
|
30
|
+
* Implementation Note:
|
|
31
|
+
* Packed appendix uses precision of 6 decimals on backend.
|
|
32
|
+
* SDK automatically converts to/from x18 during packing/unpacking.
|
|
29
33
|
*/
|
|
30
34
|
margin: BigDecimalish;
|
|
31
35
|
}
|
|
@@ -48,7 +52,7 @@ interface OrderAppendix {
|
|
|
48
52
|
* Specify if the order is a TWAP order
|
|
49
53
|
* An order CANNOT be both a TWAP order and an isolated order.
|
|
50
54
|
*/
|
|
51
|
-
twap?:
|
|
55
|
+
twap?: OrderAppendixTwapFields;
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
export type { OrderAppendix, OrderAppendixIsolatedFields,
|
|
58
|
+
export type { OrderAppendix, OrderAppendixIsolatedFields, OrderAppendixTriggerType, OrderAppendixTwapFields };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/createDeterministicLinkedSignerPrivateKey.ts"],"sourcesContent":["import { keccak256 } from 'viem';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/utils/createDeterministicLinkedSignerPrivateKey.ts"],"sourcesContent":["import { keccak256 } from 'viem';\nimport { getNadoEIP712Domain } from '../eip712/getNadoEIP712Domain';\nimport { Subaccount } from '../types/subaccountTypes';\nimport { WalletClientWithAccount } from '../types/viemTypes';\nimport { subaccountToHex } from './bytes32';\n\ninterface Params extends Subaccount {\n walletClient: WalletClientWithAccount;\n chainId: number;\n endpointAddress: string;\n}\n\n/**\n * Deterministically creates a new private key from a predetermined EIP712 message. This is used to\n * reliably create an authorized signer delegate for the subaccount across different clients. Used on the FE in order\n * to have a consistent private key for the subaccount linked signer across different clients.\n *\n * @param params\n */\nexport async function createDeterministicLinkedSignerPrivateKey(\n params: Params,\n) {\n const {\n chainId,\n endpointAddress,\n walletClient,\n subaccountName,\n subaccountOwner,\n } = params;\n\n const signedMessage = await walletClient.signTypedData({\n domain: getNadoEIP712Domain(endpointAddress, chainId),\n types: {\n CreateLinkedSignerWallet: [{ name: 'subaccount', type: 'bytes32' }],\n },\n primaryType: 'CreateLinkedSignerWallet',\n message: {\n subaccount: subaccountToHex({\n subaccountOwner,\n subaccountName,\n }),\n },\n });\n\n return keccak256(signedMessage);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA0B;AAC1B,iCAAoC;AAGpC,qBAAgC;AAehC,eAAsB,0CACpB,QACA;AACA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,gBAAgB,MAAM,aAAa,cAAc;AAAA,IACrD,YAAQ,gDAAoB,iBAAiB,OAAO;AAAA,IACpD,OAAO;AAAA,MACL,0BAA0B,CAAC,EAAE,MAAM,cAAc,MAAM,UAAU,CAAC;AAAA,IACpE;AAAA,IACA,aAAa;AAAA,IACb,SAAS;AAAA,MACP,gBAAY,gCAAgB;AAAA,QAC1B;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AAED,aAAO,uBAAU,aAAa;AAChC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/createDeterministicLinkedSignerPrivateKey.ts"],"sourcesContent":["import { keccak256 } from 'viem';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/utils/createDeterministicLinkedSignerPrivateKey.ts"],"sourcesContent":["import { keccak256 } from 'viem';\nimport { getNadoEIP712Domain } from '../eip712/getNadoEIP712Domain';\nimport { Subaccount } from '../types/subaccountTypes';\nimport { WalletClientWithAccount } from '../types/viemTypes';\nimport { subaccountToHex } from './bytes32';\n\ninterface Params extends Subaccount {\n walletClient: WalletClientWithAccount;\n chainId: number;\n endpointAddress: string;\n}\n\n/**\n * Deterministically creates a new private key from a predetermined EIP712 message. This is used to\n * reliably create an authorized signer delegate for the subaccount across different clients. Used on the FE in order\n * to have a consistent private key for the subaccount linked signer across different clients.\n *\n * @param params\n */\nexport async function createDeterministicLinkedSignerPrivateKey(\n params: Params,\n) {\n const {\n chainId,\n endpointAddress,\n walletClient,\n subaccountName,\n subaccountOwner,\n } = params;\n\n const signedMessage = await walletClient.signTypedData({\n domain: getNadoEIP712Domain(endpointAddress, chainId),\n types: {\n CreateLinkedSignerWallet: [{ name: 'subaccount', type: 'bytes32' }],\n },\n primaryType: 'CreateLinkedSignerWallet',\n message: {\n subaccount: subaccountToHex({\n subaccountOwner,\n subaccountName,\n }),\n },\n });\n\n return keccak256(signedMessage);\n}\n"],"mappings":";;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,2BAA2B;AAGpC,SAAS,uBAAuB;AAehC,eAAsB,0CACpB,QACA;AACA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,gBAAgB,MAAM,aAAa,cAAc;AAAA,IACrD,QAAQ,oBAAoB,iBAAiB,OAAO;AAAA,IACpD,OAAO;AAAA,MACL,0BAA0B,CAAC,EAAE,MAAM,cAAc,MAAM,UAAU,CAAC;AAAA,IACpE;AAAA,IACA,aAAa;AAAA,IACb,SAAS;AAAA,MACP,YAAY,gBAAgB;AAAA,QAC1B;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF,CAAC;AAED,SAAO,UAAU,aAAa;AAChC;","names":[]}
|