Skip to content

add react hooks and swap sdk provider#75

Open
ErnestMironov wants to merge 2 commits into
trader-xyz:mainfrom
ErnestMironov:react-hooks
Open

add react hooks and swap sdk provider#75
ErnestMironov wants to merge 2 commits into
trader-xyz:mainfrom
ErnestMironov:react-hooks

Conversation

@ErnestMironov

Copy link
Copy Markdown

List of React hooks:

  1. useCancelOrder return a method that takes as input:
    nonce
    orderType

  2. useCreateBasedOrder - creates an order of any NFT from a certain collection that the user has.

  3. useCreateOrder creates an order to buy an NFT, return a method that takes as input:
    collection address
    tokenId
    ERC20 address
    ERC20 amount

  4. useFullfillOrder - makes another user buy an NFT, with an order already created, takes as input:
    signedOrderObject

  5. useOrders - finds orders that match the passed parameters. Returns all orders or one specific order

  6. useQuickSwap - finds a corresponding order and executes a transaction

  7. useWallet - connects wallet, returns address and balance.

@johnrjj

johnrjj commented Sep 11, 2022

Copy link
Copy Markdown
Contributor

Hey! I'm working on switching up the repo to support the react hooks

Definitely intend on landing this PR.

@JoaoCampos89

Copy link
Copy Markdown

Hey, I recommend create maybe a new repo only for the hooks, there are users that already have their custom hooks using same functionality. Only to keep bundle size minimal and easier to mantain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants