Class: Solace::Composers::Base
- Inherits:
-
Object
- Object
- Solace::Composers::Base
- Defined in:
- lib/solace/composers/base.rb
Overview
A Base class for all composers
Direct Known Subclasses
AssociatedTokenAccountProgramCreateAccountComposer, SplTokenProgramCloseAccountComposer, SplTokenProgramInitializeMintComposer, SplTokenProgramMintToComposer, SplTokenProgramTransferCheckedComposer, SplTokenProgramTransferComposer, SystemProgramCreateAccountComposer, SystemProgramTransferComposer
Instance Attribute Summary collapse
-
#account_context ⇒ Utils::AccountContext
The AccountContext instance for the composer.
-
#params ⇒ Hash
The parameters passed to the composer.
Instance Method Summary collapse
-
#build_instruction(indices) ⇒ void
Build instruction with resolved account indices.
-
#initialize(params) ⇒ Base
constructor
Initialize the composer.
-
#setup_accounts ⇒ void
Setup accounts required for this instruction.
Constructor Details
#initialize(params) ⇒ Base
Initialize the composer
59 60 61 62 63 |
# File 'lib/solace/composers/base.rb', line 59 def initialize(params) @params = params @account_context = Utils::AccountContext.new setup_accounts end |
Instance Attribute Details
#account_context ⇒ Utils::AccountContext
Returns The AccountContext instance for the composer.
54 55 56 |
# File 'lib/solace/composers/base.rb', line 54 def account_context @account_context end |
#params ⇒ Hash
Returns The parameters passed to the composer.
48 49 50 |
# File 'lib/solace/composers/base.rb', line 48 def params @params end |
Instance Method Details
#build_instruction(indices) ⇒ void
This method returns an undefined value.
Build instruction with resolved account indices
75 76 77 |
# File 'lib/solace/composers/base.rb', line 75 def build_instruction(indices) raise NotImplementedError, 'Subclasses must implement build_instruction method' end |
#setup_accounts ⇒ void
This method returns an undefined value.
Setup accounts required for this instruction
68 69 70 |
# File 'lib/solace/composers/base.rb', line 68 def setup_accounts raise NotImplementedError, 'Subclasses must implement setup_accounts method' end |