Skip to content

savageops/ks-limit-order-API-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KyberSwap Limit Order API Demo

This repository serves as a guide for developers looking to interact with KyberSwap Limit Order via a typescript environment. For simplicity, the examples are implemented purely in Node.js so that users can focus on the backend logic required to achieve the following Limit Order operations:

  • General APIs
    • Get Chain Supported Pairs (getSupportedPairs())
    • Get Limit Order Contract Addresses (getContracts())
  • Maker APIs
    • Get Unsigned Create Order Message (postCreateOrderUnsigned())
    • Create New Order (postCreateOrder())
    • Get List Of Orders By maker (getMakerOrders())
    • Get Maker Active Making Amount (getMakerActiveAmount())
    • Get Unsigned Cancel Order(s) Message (postCancelOrderUnsigned())
    • Submit Gasless Cancel Order(s) (postCancelOrder())
    • Generate Encoded Data For Batch Cancellation (postCancelBatchOrders())
    • Generate Encoded Data For Cancel All (postCancelAllOrders())
  • Taker APIs
    • Get Orders By Token Pair (getOrders())
    • Request Operator Signature For Maker Orders (getOperatorSignature())
    • Generate Encoded Data To Fill Order (postFillOrder())
    • Generate Encoded Data To Fill Batch Order (postFillBatchOrders())

To aid with readability, each operation has its own .ts file which has been categorized under the /src/operations/ folder. Users can run specific operations by commenting or uncommenting the relevant function in index.ts.

Getting Started

To run the examples:

  • Clone this repository
  • Install dependencies: npm install
  • Set up the ethers.js signer under /src/libs/signer.ts.
  • Run dev environment with Nodemon (auto-refresh on save): npm run start:dev
  • Run dev environment: npm run start

API Specifications

Full API specifications available on our Docs:

Additional Notes

Note that the code samples in this repository are not production-ready and are meant as references to get you started on integrating KyberSwap Limit Order functionality into your dApp.

About

Sample implementation of KyberSwap Limit Order APIs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%