Class: Solace::ZarTrustlessEscrow::MediatedEscrowDeposit
- Inherits:
-
Data
- Object
- Data
- Solace::ZarTrustlessEscrow::MediatedEscrowDeposit
- Defined in:
- lib/solace/zar_trustless_escrow/types/mediated_escrow_deposit.rb
Overview
Immutable value object representing the deserialized MediatedEscrowDeposit account — the three-party escrow created by ‘mediated_deposit` and consumed by `mediated_release` / `mediated_reclaim`. Fetching from the chain is the Program layer’s responsibility — see Solace::Programs::ZarTrustlessEscrow#get_mediated_escrow_deposit.
On-chain layout (state/mediated_escrow_deposit.rs, matches the IDL):
discriminator(8), version(u8), mint(32), depositor(32), mediator(32),
beneficiary(32), amount(u64), rent_collector(Option<Pubkey>),
expires_at(Option<i64>).
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#beneficiary ⇒ Object
readonly
Returns the value of attribute beneficiary.
-
#depositor ⇒ Object
readonly
Returns the value of attribute depositor.
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#mediator ⇒ Object
readonly
Returns the value of attribute mediator.
-
#mint ⇒ Object
readonly
Returns the value of attribute mint.
-
#rent_collector ⇒ Object
readonly
Returns the value of attribute rent_collector.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
-
.deserialize(io) ⇒ MediatedEscrowDeposit
Deserializes a MediatedEscrowDeposit from a stream of Borsh-encoded data.
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount
20 21 22 |
# File 'lib/solace/zar_trustless_escrow/types/mediated_escrow_deposit.rb', line 20 def amount @amount end |
#beneficiary ⇒ Object (readonly)
Returns the value of attribute beneficiary
20 21 22 |
# File 'lib/solace/zar_trustless_escrow/types/mediated_escrow_deposit.rb', line 20 def beneficiary @beneficiary end |
#depositor ⇒ Object (readonly)
Returns the value of attribute depositor
20 21 22 |
# File 'lib/solace/zar_trustless_escrow/types/mediated_escrow_deposit.rb', line 20 def depositor @depositor end |
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at
20 21 22 |
# File 'lib/solace/zar_trustless_escrow/types/mediated_escrow_deposit.rb', line 20 def expires_at @expires_at end |
#mediator ⇒ Object (readonly)
Returns the value of attribute mediator
20 21 22 |
# File 'lib/solace/zar_trustless_escrow/types/mediated_escrow_deposit.rb', line 20 def mediator @mediator end |
#mint ⇒ Object (readonly)
Returns the value of attribute mint
20 21 22 |
# File 'lib/solace/zar_trustless_escrow/types/mediated_escrow_deposit.rb', line 20 def mint @mint end |
#rent_collector ⇒ Object (readonly)
Returns the value of attribute rent_collector
20 21 22 |
# File 'lib/solace/zar_trustless_escrow/types/mediated_escrow_deposit.rb', line 20 def rent_collector @rent_collector end |
#version ⇒ Object (readonly)
Returns the value of attribute version
20 21 22 |
# File 'lib/solace/zar_trustless_escrow/types/mediated_escrow_deposit.rb', line 20 def version @version end |
Class Method Details
.deserialize(io) ⇒ MediatedEscrowDeposit
Deserializes a MediatedEscrowDeposit from a stream of Borsh-encoded data.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/solace/zar_trustless_escrow/types/mediated_escrow_deposit.rb', line 34 def self.deserialize(io) io.read(8) # skip the 8-byte Anchor discriminator new( version: Solace::Utils::Codecs.decode_u8(io), mint: Solace::Utils::Codecs.decode_pubkey(io), depositor: Solace::Utils::Codecs.decode_pubkey(io), mediator: Solace::Utils::Codecs.decode_pubkey(io), beneficiary: Solace::Utils::Codecs.decode_pubkey(io), amount: Solace::Utils::Codecs.decode_le_u64(io), rent_collector: Solace::Utils::Codecs.decode_option_pubkey(io), expires_at: Solace::Utils::Codecs.decode_option_i64(io) ) end |