@evedex/exchange-crypto 1.0.14 → 1.0.15
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 +1 -10
- package/dist/cjs/utils/exchange.d.ts +1 -0
- package/dist/mjs/index.d.ts +1 -0
- package/dist/mjs/index.js +1 -0
- package/dist/mjs/utils/exchange.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare function signAuth(signer: WalletClient, payload: AuthPayload): Pr
|
|
|
22
22
|
export interface NormalizeLimitOrder extends CreateBaseOrder, NetworkChain {
|
|
23
23
|
quantity: string;
|
|
24
24
|
limitPrice: string;
|
|
25
|
+
postOnly?: "yes";
|
|
25
26
|
}
|
|
26
27
|
export interface SignedLimitOrder extends NormalizeLimitOrder, SignedPayload {
|
|
27
28
|
quantity: string;
|
package/dist/cjs/index.js
CHANGED
|
@@ -107,16 +107,7 @@ 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 = {
|
|
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
|
-
};
|
|
110
|
+
const normalize = Object.assign({ id: order.id, instrument: order.instrument, side: order.side, leverage: order.leverage, quantity: (0, numeric_1.toMatcherNumber)(order.quantity), limitPrice: (0, numeric_1.toMatcherNumber)(order.limitPrice), tpsl: order.tpsl, chainId }, (order.postOnly && { postOnly: "yes" }));
|
|
120
111
|
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) }));
|
|
121
112
|
return Object.assign(Object.assign({}, normalize), { signature: signer.serializeSignature(signature) });
|
|
122
113
|
});
|
|
@@ -30,6 +30,7 @@ export interface CreateBaseOrder {
|
|
|
30
30
|
export interface LimitOrder extends CreateBaseOrder {
|
|
31
31
|
quantity: Big.BigSource;
|
|
32
32
|
limitPrice: Big.BigSource;
|
|
33
|
+
postOnly: boolean;
|
|
33
34
|
}
|
|
34
35
|
export interface MarketOrder extends CreateBaseOrder {
|
|
35
36
|
timeInForce: TimeInForce;
|
package/dist/mjs/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare function signAuth(signer: WalletClient, payload: AuthPayload): Pr
|
|
|
22
22
|
export interface NormalizeLimitOrder extends CreateBaseOrder, NetworkChain {
|
|
23
23
|
quantity: string;
|
|
24
24
|
limitPrice: string;
|
|
25
|
+
postOnly?: "yes";
|
|
25
26
|
}
|
|
26
27
|
export interface SignedLimitOrder extends NormalizeLimitOrder, SignedPayload {
|
|
27
28
|
quantity: string;
|
package/dist/mjs/index.js
CHANGED
|
@@ -52,6 +52,7 @@ 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" }),
|
|
55
56
|
};
|
|
56
57
|
const signature = await signer.signTypedData(getDomainData(chainId), EIP721Schemas.createLimitOrder, {
|
|
57
58
|
...normalize,
|
|
@@ -30,6 +30,7 @@ export interface CreateBaseOrder {
|
|
|
30
30
|
export interface LimitOrder extends CreateBaseOrder {
|
|
31
31
|
quantity: Big.BigSource;
|
|
32
32
|
limitPrice: Big.BigSource;
|
|
33
|
+
postOnly: boolean;
|
|
33
34
|
}
|
|
34
35
|
export interface MarketOrder extends CreateBaseOrder {
|
|
35
36
|
timeInForce: TimeInForce;
|