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

Add Premint api js #271

Closed
wants to merge 6 commits into from
Closed

Add Premint api js #271

wants to merge 6 commits into from

Conversation

iainnash
Copy link
Collaborator

No description provided.

@oveddan
Copy link
Collaborator

oveddan commented Oct 17, 2023

please also export this api in index.ts

other api methods that would be useful:

  • updatePremint
  • deletePremint

packages/1155-contracts/package/premint-api.test.ts Outdated Show resolved Hide resolved
packages/1155-contracts/package/premint-api.test.ts Outdated Show resolved Hide resolved
packages/1155-contracts/package/premint-api.test.ts Outdated Show resolved Hide resolved
packages/1155-contracts/package/premint-api.test.ts Outdated Show resolved Hide resolved
packages/1155-contracts/package/premint-api.ts Outdated Show resolved Hide resolved
packages/1155-contracts/package/premint-api.ts Outdated Show resolved Hide resolved
network: NetworkConfig;
chain: Chain;
mintFee: BigInt;
constructor(chain: Chain) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

thoughts on just taking a chainId instead of requiring a full chain?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Full chain is needed in a few cases for viem to lazy-create a publicClient.

return await response.json();
}

async post(path: string, data: any) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor, but this should be extracted to a static function outside the class since it doesn't have any dependency on this, same as above with get. would clean up the api definition too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want to allow this to be easily overridable

Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the reason for someone wanting to override this?

return await response.json();
}

async createPremint({
Copy link
Collaborator

Choose a reason for hiding this comment

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

if this is a premint for a new contract, the account address must match the contractAdmin.

@iainnash iainnash closed this Oct 19, 2023
@iainnash iainnash deleted the add_premint_api_helper branch January 11, 2024 15:37
oveddan pushed a commit that referenced this pull request Apr 8, 2024
* Add ERC7572 support for opensea.

* add changesset

* fix tests

* fix lint
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