How to imlement minting with only private key not using InputTransactionData in @aptos-labs/wallet-adapter-react? #502
-
Hello all, hope you are doing well
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
you can create an account from the private key with something like this: https://github.com/aptos-labs/aptos-ts-sdk/blob/53a066f5c863253b1de57b2a83e9fd549bce82fe/examples/typescript/swap.ts#L209 cc @gregnazario might have more context here |
Beta Was this translation helpful? Give feedback.
-
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
You can take a look at our |
Beta Was this translation helpful? Give feedback.
-
Espero funciona |
Beta Was this translation helpful? Give feedback.
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 transactionhttps://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