If you are familiar with Ethereum, you will find that Muta's account system is similar to Ethereum.
Simply put, Muta's account is also secured by ECDSA cryptography.
A private key corresponds to a Muta account.
We can use the private key to create an account like this new Account('0x...').
Generally used for signTransaction
If you are familiar with Ethereum, you will find that Muta's account system is similar to Ethereum. Simply put, Muta's account is also secured by ECDSA cryptography. A private key corresponds to a Muta account. We can use the private key to create an account like this
new Account('0x...')
. Generally used for signTransactionHere is an example:
import { Account } from '@mutadev/account'; import { Client } from '@mutadev/client'; async function example() { const client = new Client(); const account = new Account('0x...'); // private key // create an UDT const rawTransaction = await client.composeTransaction({ serviceName: 'asset', method: 'create_asset', payload: { name: 'MyToken', symbol: 'MT', supply: 100_000_000, } }); const signedTransaction = account.signTransaction(rawTransaction); client.sendTransaction(signedTransaction); }