/* deadline, senderPublicKey, recipientId, amount - MilliLm fee - MilliLm referencedTransactionFullHash, attachment, signature */ function NewOrdinaryPaymentTransaction(data) { var transaction = Transactions.CreateTransaction({ type: ordinary, timestamp: 0, //Convert.GetEpochTime(), deadline: data.deadline, senderPublicKey: data.senderPublicKey, recipientId: data.recipientId, amount: data.amount, fee: data.fee, referencedTransactionFullHash: data.referencedTransactionFullHash, signature: data.signature /*blockId, height, id, senderId, blockTimestamp, fullHash*/ }); if (data.attachment) { transaction.SetAttachment(data.attachment); } else { transaction.SetAttachment(Attachments.GetOrdinaryPayment); } transaction.Validate(); return transaction; }
function AddNewUserEx(data) { var user = AddNewUser(data.name); data.type = UserTrType.GetUserCreate(); var tr = Transactions.CreateTransaction(data); tr.SetAttachment(AttachmentUserCreate.Create(data.name, data.description)); user.transaction = tr; return user; }