-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
protocol sdk - make MintAPIClient a class, with overridable http meth…
…ods. add full fledged mint examples. refactor MintClient (#368) * makePrepareMintTOkenParams returns single object publicClient is optional in test * updated changeset * better tsdoc comments. dont expose all methods * make token id optional * added interface for IHttpClient * fix prettier
- Loading branch information
1 parent
6a87133
commit d1c345b
Showing
6 changed files
with
606 additions
and
229 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,17 @@ | ||
--- | ||
"@zoralabs/protocol-sdk": patch | ||
--- | ||
|
||
`MintAPIClient` is now a class, that takes a chain id and httpClient in the constructor, enabling the httpClient methods `fetch`, `post`, and `retries` to be overridden. | ||
|
||
new methods on `MintAPIClient`: | ||
|
||
`getMintableForToken` - takes a token id and token contract address and returns the mintable for it. Easier to use for fetching specific tokens than `getMintable`. | ||
|
||
`MintClient` now takes the optional `PublicClient` in the constructor instead of in each function, and stores it or creates a default one if none is provided in the constructor. It also takes an optional `httpClient` param in the constructor, allowing the `fetch`, `post`, and `retries` methods to be overridden when using the api. It now internally creates the MintAPIClient. | ||
|
||
`MintClient.makePrepareMintTokenParams` has the following changes: | ||
* returns a `SimulateContractParams`, instead of an object containing it indexed by key | ||
* no longer takes a `PublicClient` as an argument (it should be specified in the constructor instead) | ||
|
||
new function `MintClient.getMintCosts` takes a mintable and quantity to mint and returns the mintFee, paidMintPrice, and totalCost. |
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 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 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
Oops, something went wrong.