Last active
December 31, 2018 07:05
-
-
Save leon-do/29b58747d07ef6845615bbf29a650fce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// load escrow account from pub key | |
const escrowAccount = await blockchain.loadAccount(escrowPubKey) | |
// build claim transaction | |
const transaction = new stellarSdk.TransactionBuilder(escrowAccount) | |
.addOperation( | |
stellarSdk.Operation.accountMerge({ | |
destination: serverKeyPair.publicKey() // send XLM to server account | |
}) | |
) | |
.build() | |
// sign transaction | |
transaction.sign(serverKeyPair) | |
// https://stellar.github.io/js-stellar-sdk/Transaction.html#signHashX | |
transaction.signHashX('c104ac676ab0b9005222043de34195f6666d92382e1e161eac7c9358f6eddeb0') | |
// broadcast transaction | |
return await blockchain.submitTransaction(transaction) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment