-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ERC20 quotes can now be obtained via the nftx api
this is a huge refactor and rewrite of the pricing api, covering @nftx/api, @nftx/core, and @nftx/trade the individual quoting methods (fetchVaultBuyPrice etc) have been removed in favour of two methods: fetchQuote, and fetchPrice fetchPrice returns an off-chain price, fetchQuote returns an on-chain quote with executable data the different types of pricing calls can now be chosen via the `type` parameter, which can be buy/sell/swap/mint/redeem and the new type: erc20 BREAKING CHANGE: price methods have been removed in favour of fetchPrice and fetchQuote BREAKING CHANGE: tradeErc20 method now takes a quote object (obtained from fetchQuote) instead of a price object (from fetchTokenBuyPrice) BREAKING CHANGE: fetchTokenBuyPrice has been replaced with fetchAmmQuote - though fetchQuote/fetchPrice should be preferred
- Loading branch information
1 parent
8536eed
commit cbd2bc1
Showing
33 changed files
with
340 additions
and
618 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { MarketplacePrice } from '@nftx/types'; | ||
import fetchQuote, { | ||
BuyArgs, | ||
MintArgs, | ||
RedeemArgs, | ||
SellArgs, | ||
TokenArgs, | ||
SwapArgs, | ||
} from './fetchQuote'; | ||
|
||
function fetchPrice(args: BuyArgs): Promise<MarketplacePrice>; | ||
function fetchPrice(args: SellArgs): Promise<MarketplacePrice>; | ||
function fetchPrice(args: SwapArgs): Promise<MarketplacePrice>; | ||
function fetchPrice(args: MintArgs): Promise<MarketplacePrice>; | ||
function fetchPrice(args: RedeemArgs): Promise<MarketplacePrice>; | ||
function fetchPrice(args: TokenArgs): Promise<MarketplacePrice>; | ||
function fetchPrice(args: any) { | ||
return fetchQuote({ ...args, quoteType: 'price' }); | ||
} | ||
|
||
export default fetchPrice; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.