@evedex/exchange-crypto 1.0.15 → 1.0.17
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.d.ts +1 -0
- package/dist/cjs/index.js +12 -3
- package/dist/cjs/utils/exchange.d.ts +1 -0
- package/dist/mjs/index.d.ts +1 -0
- package/dist/mjs/index.js +2 -1
- package/dist/mjs/utils/exchange.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export declare function signPositionCloseOrder(signer: WalletClient, order: Posi
|
|
|
52
52
|
export interface NormalizeReplaceLimitOrder extends ReplaceBaseOrder {
|
|
53
53
|
quantity: string;
|
|
54
54
|
limitPrice: string;
|
|
55
|
+
postOnly?: "yes";
|
|
55
56
|
}
|
|
56
57
|
export interface SignedReplaceLimitOrder extends NormalizeReplaceLimitOrder, SignedPayload {
|
|
57
58
|
}
|
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) {
|
|
@@ -173,7 +182,7 @@ function signReplaceLimitOrder(signer, order) {
|
|
|
173
182
|
limitPrice: (0, numeric_1.toMatcherNumber)(order.limitPrice),
|
|
174
183
|
};
|
|
175
184
|
const signature = yield signer.signTypedData((0, crypto_1.getDomainData)(yield signer.getChainId()), crypto_1.EIP721Schemas.replaceLimitOrder, Object.assign(Object.assign({}, normalize), { quantity: (0, crypto_1.toEthNumber)(normalize.quantity), limitPrice: (0, crypto_1.toEthNumber)(normalize.limitPrice) }));
|
|
176
|
-
return Object.assign(Object.assign({}, normalize), { signature: signer.serializeSignature(signature) });
|
|
185
|
+
return Object.assign(Object.assign(Object.assign({}, normalize), (order.postOnly && { postOnly: "yes" })), { signature: signer.serializeSignature(signature) });
|
|
177
186
|
});
|
|
178
187
|
}
|
|
179
188
|
function signReplaceStopLimitOrder(signer, order) {
|
|
@@ -53,6 +53,7 @@ export interface ReplaceBaseOrder {
|
|
|
53
53
|
export interface ReplaceLimitOrder extends ReplaceBaseOrder {
|
|
54
54
|
quantity: Big.BigSource;
|
|
55
55
|
limitPrice: Big.BigSource;
|
|
56
|
+
postOnly: boolean;
|
|
56
57
|
}
|
|
57
58
|
export interface ReplaceStopLimitOrder extends ReplaceLimitOrder {
|
|
58
59
|
stopPrice: Big.BigSource;
|
package/dist/mjs/index.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export declare function signPositionCloseOrder(signer: WalletClient, order: Posi
|
|
|
52
52
|
export interface NormalizeReplaceLimitOrder extends ReplaceBaseOrder {
|
|
53
53
|
quantity: string;
|
|
54
54
|
limitPrice: string;
|
|
55
|
+
postOnly?: "yes";
|
|
55
56
|
}
|
|
56
57
|
export interface SignedReplaceLimitOrder extends NormalizeReplaceLimitOrder, SignedPayload {
|
|
57
58
|
}
|
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
|
}
|
|
@@ -144,6 +144,7 @@ export async function signReplaceLimitOrder(signer, order) {
|
|
|
144
144
|
});
|
|
145
145
|
return {
|
|
146
146
|
...normalize,
|
|
147
|
+
...(order.postOnly && { postOnly: "yes" }),
|
|
147
148
|
signature: signer.serializeSignature(signature),
|
|
148
149
|
};
|
|
149
150
|
}
|
|
@@ -53,6 +53,7 @@ export interface ReplaceBaseOrder {
|
|
|
53
53
|
export interface ReplaceLimitOrder extends ReplaceBaseOrder {
|
|
54
54
|
quantity: Big.BigSource;
|
|
55
55
|
limitPrice: Big.BigSource;
|
|
56
|
+
postOnly: boolean;
|
|
56
57
|
}
|
|
57
58
|
export interface ReplaceStopLimitOrder extends ReplaceLimitOrder {
|
|
58
59
|
stopPrice: Big.BigSource;
|