Skip to content

How to imlement minting with only private key not using InputTransactionData in @aptos-labs/wallet-adapter-react? #502

Discussion options

You must be logged in to vote

To mint an nft, a user needs a wallet that holds their private key. I am not sure how you'd let users mint an nft without connecting their wallet (obviously users will not provide their private key for you).

If you use your own account to mint the nft, and you know its private key, you can generate an account based on the known private key, and then instead of calling the wallet signAndSubmitTransaction you simply use the SDK directly to submit the mint transaction
https://github.com/aptos-labs/aptos-ts-sdk/blob/main/tests/unit/account.test.ts#L96-L134
https://github.com/aptos-labs/aptos-ts-sdk/blob/main/tests/e2e/transaction/transactionSubmission.test.ts#L432-L446

const privateKey = new …

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@CryptainGolD
Comment options

Answer selected by 0xmaayan
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants