@evedex/exchange-crypto 1.0.15 → 1.0.16
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/cjs/index.js +11 -2
- package/dist/mjs/index.js +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -107,9 +107,18 @@ function signLimitOrder(signer, order) {
|
|
|
107
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
108
|
const chainId = yield signer.getChainId();
|
|
109
109
|
(0, validate_1.validatePayload)(Object.assign(Object.assign({}, order), { chainId }), crypto_1.EIP721Schemas.createLimitOrder);
|
|
110
|
-
const normalize =
|
|
110
|
+
const normalize = {
|
|
111
|
+
id: order.id,
|
|
112
|
+
instrument: order.instrument,
|
|
113
|
+
side: order.side,
|
|
114
|
+
leverage: order.leverage,
|
|
115
|
+
quantity: (0, numeric_1.toMatcherNumber)(order.quantity),
|
|
116
|
+
limitPrice: (0, numeric_1.toMatcherNumber)(order.limitPrice),
|
|
117
|
+
tpsl: order.tpsl,
|
|
118
|
+
chainId,
|
|
119
|
+
};
|
|
111
120
|
const signature = yield signer.signTypedData((0, crypto_1.getDomainData)(chainId), crypto_1.EIP721Schemas.createLimitOrder, Object.assign(Object.assign({}, normalize), { quantity: (0, crypto_1.toEthNumber)(normalize.quantity), limitPrice: (0, crypto_1.toEthNumber)(normalize.limitPrice) }));
|
|
112
|
-
return Object.assign(Object.assign({}, normalize), { signature: signer.serializeSignature(signature) });
|
|
121
|
+
return Object.assign(Object.assign(Object.assign({}, normalize), (order.postOnly && { postOnly: "yes" })), { signature: signer.serializeSignature(signature) });
|
|
113
122
|
});
|
|
114
123
|
}
|
|
115
124
|
function signMarketOrder(signer, order) {
|
package/dist/mjs/index.js
CHANGED
|
@@ -52,7 +52,6 @@ export async function signLimitOrder(signer, order) {
|
|
|
52
52
|
limitPrice: toMatcherNumber(order.limitPrice),
|
|
53
53
|
tpsl: order.tpsl,
|
|
54
54
|
chainId,
|
|
55
|
-
...(order.postOnly && { postOnly: "yes" }),
|
|
56
55
|
};
|
|
57
56
|
const signature = await signer.signTypedData(getDomainData(chainId), EIP721Schemas.createLimitOrder, {
|
|
58
57
|
...normalize,
|
|
@@ -61,6 +60,7 @@ export async function signLimitOrder(signer, order) {
|
|
|
61
60
|
});
|
|
62
61
|
return {
|
|
63
62
|
...normalize,
|
|
63
|
+
...(order.postOnly && { postOnly: "yes" }),
|
|
64
64
|
signature: signer.serializeSignature(signature),
|
|
65
65
|
};
|
|
66
66
|
}
|