Guest User

Untitled

a guest
Apr 24th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. setOptions({
  2. setFlags: 3, // Operation.AuthFlags.Required | Operation.AuthFlags.Revocable
  3. signer: {
  4. ed25519PublicKey: environment.stellar.stellarMainKey,
  5. weight: 1,
  6. },
  7. lowThreshold: 1,
  8. })
  9.  
  10. const transaction = new TransactionBuilder(bHMainAccountResponse)
  11. .addOperation(Operation.changeTrust({
  12. asset,
  13. }))
  14. .addOperation(Operation.allowTrust({
  15. assetCode: asset.code,
  16. authorize: true,
  17. trustor: bHMainKeys.publicKey(), // Secondary account
  18. source: issuerPublicKey,
  19. }))
  20. .addOperation(Operation.payment({
  21. destination: bHMainKeys.publicKey(),
  22. asset,
  23. amount: amount.toString(),
  24. source: issuerPublicKey,
  25. }))
  26. .addOperation(Operation.setOptions({
  27. masterWeight: 0,
  28. lowThreshold: 0,
  29. medThreshold: 0,
  30. highThreshold: 0,
  31. clearFlags: 7,
  32. source: bHDeactivatedKeys.publicKey(), // 3rd account
  33. }))
  34. .build()
  35.  
  36. transaction.sign(bHMainKeys)
  37.  
  38. const signedTransaction = transaction.toEnvelope().toXDR().toString('base64')
Add Comment
Please, Sign In to add comment