Class: Stellar::TransactionV0
Instance Method Summary
collapse
#apply_defaults, #hash, #merge, #sign, #sign_decorated, #to_operations
Instance Method Details
#signature_base ⇒ Object
Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 we need a Transaction to generate the signature base
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/stellar/transaction_v0.rb', line 27
def signature_base
tx = Stellar::Transaction.from_xdr(
Stellar::PublicKeyType.to_xdr(Stellar::PublicKeyType.public_key_type_ed25519) + to_xdr
)
tagged_tx = Stellar::TransactionSignaturePayload::TaggedTransaction.new(:envelope_type_tx, tx)
Stellar::TransactionSignaturePayload.new(
network_id: Stellar.current_network_id,
tagged_transaction: tagged_tx
).to_xdr
end
|
#signature_base_prefix ⇒ Object
19
20
21
22
23
|
# File 'lib/stellar/transaction_v0.rb', line 19
def signature_base_prefix
val = Stellar::EnvelopeType.envelope_type_tx_v0
Stellar.current_network_id + Stellar::EnvelopeType.to_xdr(val)
end
|
#source_account ⇒ Object
43
44
45
|
# File 'lib/stellar/transaction_v0.rb', line 43
def source_account
Stellar::MuxedAccount.ed25519(source_account_ed25519)
end
|
#to_envelope(*key_pairs) ⇒ Object
13
14
15
16
17
|
# File 'lib/stellar/transaction_v0.rb', line 13
def to_envelope(*key_pairs)
signatures = (key_pairs || []).map(&method(:sign_decorated))
TransactionEnvelope.v0(signatures: signatures, tx: self)
end
|
#to_v1 ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/stellar/transaction_v0.rb', line 5
def to_v1
Transaction.new(
**attributes.except(:source_account_ed25519, :time_bounds),
cond: Stellar::Preconditions.new(:precond_time, time_bounds),
source_account: source_account
)
end
|