Class: Stellar::Transaction

Inherits:
Object
  • Object
show all
Includes:
Concerns::Transaction
Defined in:
lib/stellar/transaction.rb

Instance Method Summary collapse

Methods included from Concerns::Transaction

#apply_defaults, #hash, #merge, #sign, #sign_decorated, #to_operations

Instance Method Details

#signature_baseObject



23
24
25
26
27
28
29
# File 'lib/stellar/transaction.rb', line 23

def signature_base
  tagged_tx = Stellar::TransactionSignaturePayload::TaggedTransaction.new(:envelope_type_tx, self)
  Stellar::TransactionSignaturePayload.new(
    network_id: Stellar.current_network_id,
    tagged_transaction: tagged_tx
  ).to_xdr
end

#to_envelope(*key_pairs) ⇒ Object



31
32
33
34
35
# File 'lib/stellar/transaction.rb', line 31

def to_envelope(*key_pairs)
  signatures = key_pairs.map(&method(:sign_decorated))

  TransactionEnvelope.v1(signatures: signatures, tx: self)
end

#to_v0Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/stellar/transaction.rb', line 5

def to_v0
  ed25519 = if .switch == Stellar::CryptoKeyType.key_type_ed25519
    .ed25519!
  else
    .med25519!.ed25519
  end

  TransactionV0.new(
    source_account_ed25519: ed25519,
    seq_num: seq_num,
    operations: operations,
    fee: fee,
    memo: memo,
    time_bounds: time_bounds,
    ext: ext
  )
end