Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

Commit 710dcab

Browse files
committed
add getOrderByHash
1 parent 17b746c commit 710dcab

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@ const loopring = require('./lib/index');
33
module.exports = {
44
common: loopring.common,
55
ethereum: loopring.ethereum,
6-
relay: loopring.relay
6+
relay: loopring.relay,
7+
WalletUtils: loopring.WalletUtils,
8+
ContractUtils: loopring.ContractUtils,
9+
EthRpcUtils: loopring.EthRpcUtils,
10+
RelayRpcUtils: loopring.RelayRpcUtils,
11+
SocketUtils: loopring.SocketUtils,
12+
Utils: loopring.Utils
713
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loopring.js",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Loopring javascript library",
55
"scripts": {
66
"lint": "eslint . --fix",

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import relay from './relay';
44
import WalletUtils from './WalletUtils';
55
import ContractUtils from './ethereum/contracts/Contracts';
66
import EthRpcUtils from './ethereum/eth';
7-
import RelayRpcUitls from './relay/relay';
7+
import RelayRpcUtils from './relay/relay';
88
import SocketUtils from './relay/socket';
99
import Utils from './common/utils';
1010
export {
@@ -14,7 +14,7 @@ export {
1414
WalletUtils,
1515
ContractUtils,
1616
EthRpcUtils,
17-
RelayRpcUitls,
17+
RelayRpcUtils,
1818
SocketUtils,
1919
Utils
2020
};

src/relay/rpc/order.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ export default class Order
4646
{
4747
return setTempStore(this.host, key, value);
4848
}
49+
50+
getOrderByHash (filter)
51+
{
52+
return getOrderHash(this.host, filter);
53+
}
4954
}
5055

5156
/**
@@ -83,9 +88,7 @@ export function getOrders (host, filter)
8388
/**
8489
* @description Get cut off time of the address.
8590
* @param host
86-
* @param address
87-
* @param delegateAddress
88-
* @param blockNumber
91+
* @param filter
8992
* @returns {Promise.<*>}
9093
*/
9194
export function getCutoff (host, filter)
@@ -314,3 +317,16 @@ export function cancelOrder (host, {sign, orderHash, tokenS, tokenB, cutoff, typ
314317
return Promise.resolve(new Response(code.PARAM_INVALID.code, code.PARAM_INVALID.msg));
315318
}
316319
}
320+
321+
export function getOrderByHash (host, filter)
322+
{
323+
const body = {};
324+
body.method = 'loopring_getOrderByHash';
325+
body.params = [{orderHash: filter.orderHash}];
326+
body.id = id();
327+
body.jsonrpc = '2.0';
328+
return request(host, {
329+
method: 'post',
330+
body
331+
});
332+
}

0 commit comments

Comments
 (0)