Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SDK factory client patterns #353

Closed
wants to merge 22 commits into from
Closed

Make SDK factory client patterns #353

wants to merge 22 commits into from

Conversation

iainnash
Copy link
Collaborator

@iainnash iainnash commented Nov 13, 2023

Make all client patterns standard in the new SDK.

@iainnash iainnash marked this pull request as ready for review November 13, 2023 20:06
@iainnash iainnash changed the title Rename protocol sdk Make SDK factory client patterns Nov 13, 2023
@@ -33,18 +33,49 @@ async function mintNFT(
}
```

### Creating an 1155 contract:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for adding this!

@@ -149,21 +149,34 @@ describe("ZoraCreator1155Premint", () => {
});
premintClient.apiClient.postSignature = vi.fn();

const premint = await premintClient.executePremintWithWallet({
const { request } = await premintClient.executePremint({
account: deployerAccount!,
data: await premintClient.getPremintData({
Copy link
Collaborator

@oveddan oveddan Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im realizing now that this name could be better getPremintData - "data" can mean anything. can we give it a better name that describes what it refers to? like getPremintAndSignature ?

@@ -181,6 +176,17 @@ export class PremintClient extends ClientBase {
return zoraCreatorFixedPriceSaleStrategyAddress[999];
}

getDataFromPremintReceipt(receipt: TransactionReceipt) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better name would be parsePremintTxReceipt (adding the word data to the function name doesnt give any more info about what it's returning)

Copy link
Collaborator

@oveddan oveddan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, minor suggestions that can be done in a future version

import type { Address, WalletClient } from "viem";

async function mintNFT(
walletClient: WalletClient,
address: Address,
tokenId: bigint,
) {
const mintAPI = new MintAPI(walletClient.chain);
const mintAPI = createMintClient({ chain: walletClient.chain });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: const mintAPI should be cost mintClient

@oveddan
Copy link
Collaborator

oveddan commented Nov 13, 2023

closed in service of #356 which has single squashed commit and new branch as a stacked diff

@oveddan oveddan closed this Nov 13, 2023
@oveddan oveddan deleted the rename_protocol_sdk branch November 13, 2023 23:02
oveddan added a commit that referenced this pull request Nov 13, 2023
duplicate of #353 but with proper commit history (and rebasing off of a stacked diff)
iainnash pushed a commit that referenced this pull request Jan 5, 2024
duplicate of #353 but with proper commit history (and rebasing off of a stacked diff)
iainnash pushed a commit that referenced this pull request Jan 11, 2024
duplicate of #353 but with proper commit history (and rebasing off of a stacked diff)
iainnash pushed a commit that referenced this pull request Jan 11, 2024
duplicate of #353 but with proper commit history (and rebasing off of a stacked diff)
oveddan added a commit that referenced this pull request May 10, 2024
<!--- Provide a general summary of your changes in the Title above -->

## Description

* Updates the mints manager `setMetadataURIs` with the ability to notify for each token id a url update on the mints 1155 contract
* Adds a test that verifiers the desired metadata uris
* updates the deployment scripts to set the correct metadata uris

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## Does this change the ABI/API?

- [ ] This changes the ABI/API

<!-- If so, please describe how and what potential impact this may have -->

## What tests did you add/modify to account for these changes

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New module / feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] i added a changeset to account for this change

## Reviewer Checklist:

- [ ] My review includes a symposis of the changes and potential issues
- [ ] The code style is enforced
- [ ] There are no risky / concerning changes / additions to the PR
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.

2 participants