Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

add MintWithOptions #118

Merged
merged 4 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions thirdweb/erc721_signature_minting.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,20 @@ func newERC721SignatureMinting(provider *ethclient.Client, address common.Addres
// // Learn more about how to craft a payload in the Generate() function
// signedPayload, err := contract.Signature.Generate(payload)
// tx, err := contract.Signature.Mint(context.Background(), signedPayload)

// Deprecated: use MintAndAwait
func (signature *ERC721SignatureMinting) Mint(ctx context.Context, signedPayload *SignedPayload721) (*types.Transaction, error) {
return signature.MintAndAwait(ctx, signedPayload)
}

func (signature *ERC721SignatureMinting) MintAndAwait(ctx context.Context, signedPayload *SignedPayload721) (*types.Transaction, error) {
txOpts, err := signature.Helper.GetTxOptions(ctx)
if err != nil {
return nil, err
}

tx, err := signature.MintWithOpts(ctx, signedPayload, txOpts)

if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion thirdweb/nft_collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func TestSignatureMintNft(t *testing.T) {

assert.True(t, valid)

_, err = nft.Signature.Mint(context.Background(), payload)
_, err = nft.Signature.MintAndAwait(context.Background(), payload)
assert.Nil(t, err)

balance, _ = nft.Balance(context.Background())
Expand Down