dzham
Should this operation be wrapped in a transaction? Also, I know, that the source is optional. However, the explanation on the page is not clear; "Defaults to the transaction's source account.". For now, I am using the root account because, I want to fund this account to begin with.
This is my approach:
var transaction = new StellarSdk.TransactionBuilder(sourceAccount)
.addOperation(StellarSdk.Operation.createAccount({
destination: destinationId,
startingBalance: xferAmount,
source : sourceKeys.publicKey()
}))
.addMemo(StellarSdk.Memo.text('Test Transaction'))
.build();
transaction.sign(sourceKeys);
server.submitTransaction(transaction);