Skip to content

Instantly share code, notes, and snippets.

@leon-do
Last active December 31, 2018 07:05
Show Gist options
  • Save leon-do/29b58747d07ef6845615bbf29a650fce to your computer and use it in GitHub Desktop.
Save leon-do/29b58747d07ef6845615bbf29a650fce to your computer and use it in GitHub Desktop.
// 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