⚠️ createBatchWallet(sender, n, currencyID, amount)

Feature

Return an account and a raw operation for creating multiple contract-account.

Parameters

string sender address,

number n, // number of account to create

string currencyID,

int | string amount //amount of tokens used to create each contract account

Return Value

object { 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.contract.createBatchWallet(senderAddress, n, currencyID, amount);
console.log(wallet);
console.log(operation);

// output
// wallet
[
  {
    privatekey: '35453d7f3ffb1eeb46d4c6565d8c0d867675bc120ed5e7743f5983cd2226ec62fpr',
    publickey: '0217ec3a7b21a1f4ece7456b14707b6d78594420f9fda71e5f2abaf2e5dac79886fpu',
    address: '0xCfBC9Caaf527423186D906ea3e8f4A5De4213b9efca'
  },
  {
    privatekey: '222504c7a62f764383e68d560741caa1b09e50bb286d91405044bf6870af8d94fpr',
    publickey: '025bcf0e824233bf1b6029d132961fe9b36a071e40a5def891d6c8397d16e5b9e4fpu',
    address: '0xB5660B98b89191fb1445fA8ACe2fC6900761D0b3fca'
  },
  {
    privatekey: 'f0bef50efed037a0150633949df54b6282e29359a5ae14d26c121feba665c134fpr',
    publickey: '03b14056b159feeb93cf109ee590fe47a05c0c6191007d9ee1723f08044996bdf3fpu',
    address: '0xa41Da87e97d81cAc6c5Ce86c01C544090Fe489d0fca'
  }
]
Operation {
  id: 'mitum',
  fact: CreateContractAccountFact {
    hint: Hint {
      s: 'mitum-extension-create-contract-account-operation-fact'
    },
    token: Token { s: '2025-01-14 02:22:24.486 +0000 UTC' },
    _hash: <Buffer 25 f8 e1 cd 8c b6 dd 75 e3 06 16 19 87 44 dd e8 ab 6b 56 c2 42 c7 b5 80 ba f4 03 1b 7e 19 96 97>,
    sender: Address {
      s: '0x15838b16912F79AA7aDB45258d146E488A971869fca',
      type: 'mitum'
    },
    items: [
      [CreateContractAccountItem],
      [CreateContractAccountItem],
      [CreateContractAccountItem]
    ]
  },
  hint: Hint { s: 'mitum-extension-create-contract-account-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

Last updated