createBatchWallet(sender, n, currency, amount)
Feature
Return array of key pair and a raw operation include multiple items with multiple create account fact.
Used to create n number of single sig accounts.
Note : Deploying this operation, n accounts with a given amount of tokens are created at once.
Parameters
string sender address,
number n, // number of account to create
string currencyID,
int | string amount //amount of tokens used to create each account
Return Value
object wallet info { wallet : array of key pairs, operation : object currency transfer operation }
example
const senderAddress = "0x15838b16912F79AA7aDB45258d146E488A971869fca";
const currencyID = "MIT";
const amount = 1;
const n = 3;
const { wallet, operation } = mitum.account.createBatchWallet(senderAddress, n, currencyID, amount);
console.log(wallet);
console.log(operation);
// output
// wallet
[
{
privatekey: 'fa6b1197ec14133d0cbf026b623586ecad79e3ac4c48158e8b06093a3cf7d2c1fpr',
publickey: '03a5860f94c6228e7601d4727ba3cfba11c5320c52e8b71f74d9ae9999fd6ff7d3fpu',
address: '0x77A1a35dEB2bcc5Ed061524aa9758f2605F7DA13fca'
},
{
privatekey: '7d0e5927b8cbec6d445ec90baae4181f9e24f78d5627b1b8e6804d8424664883fpr',
publickey: '03e823926b3e3e29707f9e196df1bcaf5ed9241cfccb059f014d2f0eaf6dc319f7fpu',
address: '0xdCA5d22F192a5703d629602c25AC7252cE94dBa8fca'
},
{
privatekey: 'b5728771020fd1e7d90be39b1a83b3c458b3cdbaac32b7895c12eab55a5dbdb1fpr',
publickey: '028e8b37a6fa82da0c1370963d1680fa0901793d867ff1bce99d77ae83603e5fa5fpu',
address: '0x517ffA55D06AaEc6Fa9d27B54e21ebfeb58Ff692fca'
}
]
// operation
Operation {
id: 'mitum',
fact: TransferFact {
hint: Hint { s: 'mitum-currency-transfer-operation-fact' },
token: Token { s: '2024-05-20 07:12:16.28 +0000 UTC' },
_hash: <Buffer d6 04 bc e4 40 33 e4 d8 17 b8 02 ba 65 c1 92 1a 96 1a 24 a6 1c ae c0 75 6b 8c 22 65 f0 43 17 fc>,
sender: Address {
s: '0x15838b16912F79AA7aDB45258d146E488A971869fca',
type: 'mitum'
},
items: [ [TransferItem], [TransferItem], [TransferItem] ]
},
hint: Hint { s: 'mitum-currency-transfer-operation' },
_factSigns: [],
_hash: <Buffer >
}Last updated