Rook
Search…
Integrate your Dapp/Wallet
Protocols or projects may directly forward orders to the Hiding Book from a web3 interface through a simple integration.

Requirements

To interface with the Hiding Book you will need the following:
  • Ability to format, sign, and manipulate the 0xv4 order format
  • Ability to interface with a wallet provider of your choice e.g. MetaMask, Ledger, etc
  • UX to gather the following user input:
    • tokenIn - the units of tokens to be paid
    • tokenOut - the units of tokens to be received
    • order expiration
    • price
  • UX for displaying orders
    • view open orders
    • cancel orders
    • view historic orders

References

Sample UX flow

User arrives at the trading interface
  • Make a call to the GET /info endpoint to get the information you need to initialize the trading screen. The response contains useful information like supported tokens and data needed to sign orders.
User is ready to sign an order
It's time to submit the signed order
  • Make a call to the POST /orders endpoint to post the order to the Hiding Book for validation. The server will alert you of any errors, insufficient balances, or insufficient allowances.
User is asked to approve allowances
  • Allowances are to be made where the spender is the 0xv4 verifyingContract provided in the GET /info endpoint.
User wants to view orders
User wants to cancel an order
Calculating an Order's Fill %
  • Use the order data and make a simple calculation: fillPercentage = filledAmount_takerToken / takerAmount
Determine order status

How to claim rewards

We have 4 reward programs, the claiming logic is the same for all rewards programs.
Step 1. Call Indibo API with your address.
  • Open your terminal and run following command or use your browser to get the response.
1
curl https://indibo.herokuapp.com/rewards?address={address_of_trader}
Copied!
Step 2. Go to etherscan and connect your wallet.
  • Open your browser and copy the following link.
1
# for HidingGame (ACT 2 1st half) (hiding)
2
https://etherscan.io/address/0xd81e97075Dbda444eF65Db3a96706c679b5311fD#writeContract
3
​
4
# for HidingGame (ACT 2 2nd half) (hiding2)
5
https://etherscan.io/address/0x8d5541dB390a394d01a5eB03FC8160Ba66df184c#writeContract
6
​
7
# for HidingGame (ACT 3 1st half) (hiding3)
8
https://etherscan.io/address/0xc45bdd7e82cd72f4cb138aeeb175599e6e12be17#writeContract
9
​
10
# for HidingGame (ACT 3 2nd half) (hiding4)
11
https://etherscan.io/address/0x25d27d026ab896fad8c8080f5b0e3fbd6667b139#writeContract
12
​
13
# for HidingGame (ACT 4 1st half) (hiding5)
14
https://etherscan.io/address/0xC00ba24eBcB6FB4aecBe5b78431Ea49D608f5565#writeContract
15
​
16
# for HidingGame (ACT 4 2nd half) (hiding6)
17
https://etherscan.io/address/0x4b26b5820aa3bac65636036e1434128a308a271e#writeContract
18
​
19
# for LiquidityPool-PreMining (lp-pre)
20
https://etherscan.io/address/lp-pre-distributor.rook.eth#writeContract
21
​
22
# for LiquidityPool-Act1 (lp)
23
https://etherscan.io/address/0xcadF6735144D1d7f1A875a5561555cBa5df2f75C#writeContract
24
​
25
# for LiquidityPool-Act2 (lpq2)
26
https://etherscan.io/address/0x2777b798fdfb906d42b89cf8f9de541db05dd6a1#writeContract
27
​
28
# for LiquidityPool-Act3 (lpq3)
29
https://etherscan.io/address/0x59ff8975c813c1e70bdf2bcb8c02886928e4ea2d#writeContract
30
​
31
# for LiquidityPool-Act4 (lpq4)
32
https://etherscan.io/address/0x9Bc9BDfe0843f44cF0878700501bB9142CDad2B8#writeContract
33
​
34
# for Lender-Act3 (lender)
35
https://etherscan.io/address/0xa8F76e3Ef9960A0A8256A43D1F7Af685e5014a4E#writeContract
36
​
37
# for Lender-Act4 (lender2)
38
https://etherscan.io/address/0xAe7b93a591c37eA37Ed8Bc7B6B999C85f2eD2405#writeContract
Copied!
  • Click Connect to Web3 to connect your MetaMask or WalletConnect.
Step 3. Claim your rewards.
  • Expand the claim function.
You will see 4 input fields: _to (address), _earningsToDate (uint256), _nonce (uint256), _signature (bytes)
  • Fill in the inputs with the Indibo API response.
owner --> _to (address)
earnings_to_date --> _earningsToDate (uint256)
nonce --> _nonce (uint256)
signature --> _signature (bytes)
  • Click Write and approve the claim in your wallet.
Step 4. Success! You will receive your rewards
​