solana-ruby-kit 8.2.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +82 -12
  3. data/lib/solana/ruby/kit/accounts/maybe_account.rb +1 -1
  4. data/lib/solana/ruby/kit/addresses/address.rb +1 -1
  5. data/lib/solana/ruby/kit/addresses/curve.rb +1 -1
  6. data/lib/solana/ruby/kit/addresses/program_derived_address.rb +1 -1
  7. data/lib/solana/ruby/kit/addresses/public_key.rb +1 -1
  8. data/lib/solana/ruby/kit/codecs/codec.rb +95 -1
  9. data/lib/solana/ruby/kit/codecs/data_structures.rb +51 -8
  10. data/lib/solana/ruby/kit/codecs/numbers.rb +49 -50
  11. data/lib/solana/ruby/kit/codecs/strings.rb +132 -6
  12. data/lib/solana/ruby/kit/encoding/base58.rb +1 -1
  13. data/lib/solana/ruby/kit/errors.rb +6 -0
  14. data/lib/solana/ruby/kit/fast_stable_stringify.rb +1 -1
  15. data/lib/solana/ruby/kit/functional.rb +1 -1
  16. data/lib/solana/ruby/kit/instruction_plans/instruction_plan.rb +1 -1
  17. data/lib/solana/ruby/kit/instruction_plans/max_instructions.rb +1 -1
  18. data/lib/solana/ruby/kit/instruction_plans/transaction_plan.rb +1 -1
  19. data/lib/solana/ruby/kit/instruction_plans/transaction_plan_executor.rb +2 -2
  20. data/lib/solana/ruby/kit/instruction_plans/transaction_plan_result.rb +1 -1
  21. data/lib/solana/ruby/kit/instruction_plans/transaction_planner.rb +2 -2
  22. data/lib/solana/ruby/kit/instructions/accounts.rb +1 -1
  23. data/lib/solana/ruby/kit/instructions/instruction.rb +1 -1
  24. data/lib/solana/ruby/kit/instructions/roles.rb +1 -1
  25. data/lib/solana/ruby/kit/keys/key_pair.rb +1 -1
  26. data/lib/solana/ruby/kit/keys/private_key.rb +1 -1
  27. data/lib/solana/ruby/kit/keys/public_key.rb +1 -1
  28. data/lib/solana/ruby/kit/keys/signatures.rb +1 -1
  29. data/lib/solana/ruby/kit/offchain_messages/codec.rb +1 -1
  30. data/lib/solana/ruby/kit/offchain_messages/message_v1.rb +1 -1
  31. data/lib/solana/ruby/kit/options/option.rb +1 -1
  32. data/lib/solana/ruby/kit/plugin_core.rb +1 -1
  33. data/lib/solana/ruby/kit/programs/associated_token_account.rb +1 -1
  34. data/lib/solana/ruby/kit/programs/stake_program.rb +1 -1
  35. data/lib/solana/ruby/kit/programs/system_program.rb +1 -1
  36. data/lib/solana/ruby/kit/programs.rb +1 -1
  37. data/lib/solana/ruby/kit/promises.rb +1 -1
  38. data/lib/solana/ruby/kit/resource_limit_estimation.rb +1 -1
  39. data/lib/solana/ruby/kit/rpc_parsed_types/address_lookup_table.rb +1 -1
  40. data/lib/solana/ruby/kit/rpc_parsed_types/nonce_account.rb +1 -1
  41. data/lib/solana/ruby/kit/rpc_parsed_types/stake_account.rb +1 -1
  42. data/lib/solana/ruby/kit/rpc_parsed_types/token_account.rb +1 -1
  43. data/lib/solana/ruby/kit/rpc_parsed_types/vote_account.rb +1 -1
  44. data/lib/solana/ruby/kit/rpc_types/cluster_url.rb +1 -1
  45. data/lib/solana/ruby/kit/rpc_types/commitment.rb +1 -1
  46. data/lib/solana/ruby/kit/rpc_types/lamports.rb +1 -1
  47. data/lib/solana/ruby/kit/rpc_types/sol.rb +1 -1
  48. data/lib/solana/ruby/kit/signers/keypair_signer.rb +1 -1
  49. data/lib/solana/ruby/kit/subscribable/async_iterable.rb +1 -1
  50. data/lib/solana/ruby/kit/subscribable/bridge_store_to_async_iterable.rb +1 -1
  51. data/lib/solana/ruby/kit/subscribable/reactive_action_store.rb +1 -1
  52. data/lib/solana/ruby/kit/subscribable/reactive_stream_store.rb +1 -1
  53. data/lib/solana/ruby/kit/sysvars/clock.rb +1 -1
  54. data/lib/solana/ruby/kit/sysvars/epoch_schedule.rb +1 -1
  55. data/lib/solana/ruby/kit/sysvars/last_restart_slot.rb +1 -1
  56. data/lib/solana/ruby/kit/sysvars/rent.rb +1 -1
  57. data/lib/solana/ruby/kit/sysvars.rb +1 -1
  58. data/lib/solana/ruby/kit/transaction_confirmation.rb +1 -1
  59. data/lib/solana/ruby/kit/transaction_introspection/compiled_transaction_message.rb +1 -1
  60. data/lib/solana/ruby/kit/transaction_introspection/decode_rpc_transaction.rb +1 -1
  61. data/lib/solana/ruby/kit/transaction_introspection/get_inner_instructions.rb +1 -1
  62. data/lib/solana/ruby/kit/transaction_introspection/get_instructions.rb +1 -1
  63. data/lib/solana/ruby/kit/transaction_introspection/walk_instructions.rb +1 -1
  64. data/lib/solana/ruby/kit/transaction_messages/compute_budget.rb +1 -1
  65. data/lib/solana/ruby/kit/transaction_messages/resource_limit_validation.rb +1 -1
  66. data/lib/solana/ruby/kit/transaction_messages/transaction_message.rb +1 -1
  67. data/lib/solana/ruby/kit/transactions/compiler.rb +2 -2
  68. data/lib/solana/ruby/kit/transactions/transaction.rb +30 -10
  69. data/lib/solana/ruby/kit/version.rb +1 -1
  70. data/lib/solana/ruby/kit/wallet_standard.rb +3 -3
  71. metadata +1 -1
@@ -95,6 +95,10 @@ module Solana::Ruby::Kit
95
95
  CODECS__INVALID_BYTE_LENGTH = :SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH
96
96
  CODECS__EXPECTED_ZERO_VALUE_TO_MATCH_ITEM_FIXED_DISCRIMINATOR = :SOLANA_ERROR__CODECS__EXPECTED_ZERO_VALUE_TO_MATCH_ITEM_FIXED_DISCRIMINATOR
97
97
  CODECS__FIXED_NULLABLE_CANNOT_WRAP_VARIABLE_SIZE_CODEC = :SOLANA_ERROR__CODECS__FIXED_NULLABLE_CANNOT_WRAP_VARIABLE_SIZE_CODEC
98
+ # context: { bytes:, offset: }
99
+ CODECS__INVALID_UTF8_BYTES = :SOLANA_ERROR__CODECS__INVALID_UTF8_BYTES
100
+ # context: { index:, value: }
101
+ CODECS__INVALID_UTF8_STRING = :SOLANA_ERROR__CODECS__INVALID_UTF8_STRING
98
102
 
99
103
  # ── RPC / JSON-RPC ────────────────────────────────────────────────────────
100
104
  RPC__INTEGER_OVERFLOW_WHILE_SERIALIZING_LARGE_INTEGER = :SOLANA_ERROR__RPC__INTEGER_OVERFLOW_WHILE_SERIALIZING_LARGE_INTEGER
@@ -244,6 +248,8 @@ module Solana::Ruby::Kit
244
248
  CODECS__INVALID_BYTE_LENGTH => 'Expected %{expected} bytes but got %{actual}',
245
249
  CODECS__EXPECTED_ZERO_VALUE_TO_MATCH_ITEM_FIXED_DISCRIMINATOR => 'Expected zero value to match fixed discriminator',
246
250
  CODECS__FIXED_NULLABLE_CANNOT_WRAP_VARIABLE_SIZE_CODEC => 'A fixed-size nullable codec cannot wrap a variable-size codec',
251
+ CODECS__INVALID_UTF8_BYTES => 'Invalid UTF-8 byte sequence at offset %{offset}',
252
+ CODECS__INVALID_UTF8_STRING => 'Invalid UTF-8 string at index %{index}',
247
253
 
248
254
  # RPC
249
255
  RPC__INTEGER_OVERFLOW_WHILE_SERIALIZING_LARGE_INTEGER => 'Integer overflow while serializing large integer %{value}',
@@ -8,7 +8,7 @@ module Solana::Ruby::Kit
8
8
  module FastStableStringify
9
9
  extend T::Sig
10
10
 
11
- module_function
11
+ extend self
12
12
 
13
13
  # Serialize +value+ to a deterministic JSON string.
14
14
  # Hash keys are sorted lexicographically at every level.
@@ -6,7 +6,7 @@ module Solana::Ruby::Kit
6
6
  # Mirrors the TypeScript package @solana/functional.
7
7
  module Functional
8
8
  extend T::Sig
9
- module_function
9
+ extend self
10
10
 
11
11
  # Passes an initial value through a series of single-argument callables,
12
12
  # returning the final result.
@@ -97,7 +97,7 @@ module Solana::Ruby::Kit
97
97
 
98
98
  # ── Factory helpers ────────────────────────────────────────────────────────
99
99
 
100
- module_function
100
+ extend self
101
101
 
102
102
  # Wraps a single instruction in a plan.
103
103
  # Mirrors `singleInstructionPlan(instruction)`.
@@ -16,7 +16,7 @@ module Solana::Ruby::Kit
16
16
  # The hard maximum number of top-level instructions the transaction format can encode.
17
17
  TRANSACTION_INSTRUCTION_LIMIT = T.let(64, Integer)
18
18
 
19
- module_function
19
+ extend self
20
20
 
21
21
  # Resolves the effective maximum number of instructions allowed in a transaction message,
22
22
  # falling back to the default when no value is provided.
@@ -41,7 +41,7 @@ module Solana::Ruby::Kit
41
41
  def kind = :parallel
42
42
  end
43
43
 
44
- module_function
44
+ extend self
45
45
 
46
46
  # Creates a single-message plan.
47
47
  # Mirrors `singleTransactionPlan(transactionMessage)`.
@@ -9,7 +9,7 @@ module Solana::Ruby::Kit
9
9
  module InstructionPlans
10
10
  extend T::Sig
11
11
 
12
- module_function
12
+ extend self
13
13
 
14
14
  # Creates a TransactionPlanExecutor — a callable that traverses a TransactionPlan,
15
15
  # executing each single transaction message and collecting results.
@@ -111,7 +111,7 @@ module Solana::Ruby::Kit
111
111
 
112
112
  # ── Private helpers ────────────────────────────────────────────────────────
113
113
 
114
- module_function
114
+ extend self
115
115
 
116
116
  sig { params(plan: T.untyped, execute_fn: T.untyped, state: T.untyped).returns(T.untyped) }
117
117
 
@@ -74,7 +74,7 @@ module Solana::Ruby::Kit
74
74
  def kind = :parallel
75
75
  end
76
76
 
77
- module_function
77
+ extend self
78
78
 
79
79
  # ── Result factory helpers ────────────────────────────────────────────────
80
80
 
@@ -11,7 +11,7 @@ module Solana::Ruby::Kit
11
11
  module InstructionPlans
12
12
  extend T::Sig
13
13
 
14
- module_function
14
+ extend self
15
15
 
16
16
  # Creates a TransactionPlanner — a callable that converts an InstructionPlan
17
17
  # into a TransactionPlan by packing instructions into transaction messages.
@@ -71,7 +71,7 @@ module Solana::Ruby::Kit
71
71
 
72
72
  # ── Private helpers ────────────────────────────────────────────────────────
73
73
 
74
- module_function
74
+ extend self
75
75
 
76
76
  sig { params(plan: T.untyped, ctx: T.untyped).returns(T.untyped) }
77
77
 
@@ -19,7 +19,7 @@ module Solana::Ruby::Kit
19
19
 
20
20
  # AccountMeta subtypes — mirrors the four TypeScript convenience types.
21
21
 
22
- module_function
22
+ extend self
23
23
 
24
24
  # Creates a read-only account reference.
25
25
  sig { params(address: Addresses::Address).returns(AccountMeta) }
@@ -18,7 +18,7 @@ module Solana::Ruby::Kit
18
18
  const :data, T.nilable(String) # binary String (Uint8Array equivalent)
19
19
  end
20
20
 
21
- module_function
21
+ extend self
22
22
 
23
23
  # Returns true if the instruction targets the given program address.
24
24
  # Mirrors `isInstructionForProgram()`.
@@ -19,7 +19,7 @@ module Solana::Ruby::Kit
19
19
 
20
20
  ALL = T.let([READONLY, WRITABLE, READONLY_SIGNER, WRITABLE_SIGNER].freeze, T::Array[Integer])
21
21
 
22
- module_function
22
+ extend self
23
23
 
24
24
  # Returns true if the role requires the account to sign the transaction.
25
25
  sig { params(role: Integer).returns(T::Boolean) }
@@ -24,7 +24,7 @@ module Solana::Ruby::Kit
24
24
  const :verify_key, T.untyped # RbNaCl::VerifyKey
25
25
  end
26
26
 
27
- module_function
27
+ extend self
28
28
 
29
29
  # Generates a fresh Ed25519 key pair using a cryptographically secure RNG.
30
30
  # Mirrors `generateKeyPair()` in TypeScript.
@@ -7,7 +7,7 @@ require_relative '../errors'
7
7
  module Solana::Ruby::Kit
8
8
  module Keys
9
9
  extend T::Sig
10
- module_function
10
+ extend self
11
11
 
12
12
  # Creates an Ed25519 signing key from a raw 32-byte private key seed.
13
13
  #
@@ -7,7 +7,7 @@ require_relative '../errors'
7
7
  module Solana::Ruby::Kit
8
8
  module Keys
9
9
  extend T::Sig
10
- module_function
10
+ extend self
11
11
 
12
12
  # Derives the Ed25519 verification (public) key from a signing (private) key.
13
13
  #
@@ -60,7 +60,7 @@ module Solana::Ruby::Kit
60
60
  SIGNATURE_MIN_STR_LEN = 64
61
61
  SIGNATURE_MAX_STR_LEN = 88
62
62
 
63
- module_function
63
+ extend self
64
64
 
65
65
  # Returns true if the string is a valid base58-encoded Ed25519 signature.
66
66
  # Mirrors `isSignature()` in TypeScript.
@@ -15,7 +15,7 @@ module Solana::Ruby::Kit
15
15
 
16
16
  MAGIC = T.let("\xFF\xFF".b.freeze, String)
17
17
 
18
- module_function
18
+ extend self
19
19
 
20
20
  # Serialize a Message to its canonical binary form.
21
21
  sig { params(msg: Message).returns(String) }
@@ -36,7 +36,7 @@ module Solana::Ruby::Kit
36
36
  def version = 1
37
37
  end
38
38
 
39
- module_function
39
+ extend self
40
40
 
41
41
  # Asserts that a version 1 offchain message received from an untrusted source is the
42
42
  # message it was expected to be.
@@ -57,7 +57,7 @@ module Solana::Ruby::Kit
57
57
  # accepts Option<T>, T, or nil — useful for codec input.
58
58
  OptionOrNullable = T.type_alias { T.untyped }
59
59
 
60
- module_function
60
+ extend self
61
61
 
62
62
  # Wraps a value in Some. Mirrors `some<T>(value)`.
63
63
  sig { params(value: T.untyped).returns(Solana::Ruby::Kit::Options::Some[T.untyped]) }
@@ -48,7 +48,7 @@ module Solana::Ruby::Kit
48
48
  module PluginCore
49
49
  extend T::Sig
50
50
 
51
- module_function
51
+ extend self
52
52
 
53
53
  sig { returns(PluginClient) }
54
54
  def create_client
@@ -47,7 +47,7 @@ module Solana::Ruby::Kit
47
47
  Addresses::Address
48
48
  )
49
49
 
50
- module_function
50
+ extend self
51
51
 
52
52
  # Derives the canonical Associated Token Account address (a PDA) for a
53
53
  # given wallet and mint.
@@ -40,7 +40,7 @@ module Solana::Ruby::Kit
40
40
  DISCRIMINATOR_INITIALIZE = T.let(0, Integer)
41
41
  DISCRIMINATOR_DELEGATE = T.let(2, Integer)
42
42
 
43
- module_function
43
+ extend self
44
44
 
45
45
  # Builds the two instructions needed to create and initialise a new stake
46
46
  # account funded from +from+.
@@ -27,7 +27,7 @@ module Solana::Ruby::Kit
27
27
  # Instruction discriminators (u32 little-endian).
28
28
  DISCRIMINATOR_TRANSFER = T.let(2, Integer)
29
29
 
30
- module_function
30
+ extend self
31
31
 
32
32
  # Builds a System Program Transfer instruction that moves +lamports+ from
33
33
  # +sender+ to +recipient+.
@@ -13,7 +13,7 @@ module Solana::Ruby::Kit
13
13
  module Programs
14
14
  extend T::Sig
15
15
 
16
- module_function
16
+ extend self
17
17
 
18
18
  # Returns true when +err+ is a custom program error, optionally matching
19
19
  # a specific error code.
@@ -10,7 +10,7 @@ module Solana::Ruby::Kit
10
10
  module Promises
11
11
  extend T::Sig
12
12
 
13
- module_function
13
+ extend self
14
14
 
15
15
  # Run each callable in a dedicated thread and return the first result.
16
16
  # All losing threads are killed to avoid memory leaks — analogous to the
@@ -19,7 +19,7 @@ module Solana::Ruby::Kit
19
19
 
20
20
  PROVISORY_LIMIT = T.let(0, Integer)
21
21
 
22
- module_function
22
+ extend self
23
23
 
24
24
  # Returns a callable that estimates the resource limits required by a transaction message
25
25
  # by simulating it with maximum limits set, then reading back the actual consumption.
@@ -14,7 +14,7 @@ module Solana::Ruby::Kit
14
14
  T.untyped
15
15
  )
16
16
 
17
- module_function
17
+ extend self
18
18
 
19
19
  sig { params(raw: T::Hash[String, T.untyped]).returns(T.untyped) }
20
20
  def parse_address_lookup_table(raw)
@@ -14,7 +14,7 @@ module Solana::Ruby::Kit
14
14
  T.untyped
15
15
  )
16
16
 
17
- module_function
17
+ extend self
18
18
 
19
19
  sig { params(raw: T::Hash[String, T.untyped]).returns(T.untyped) }
20
20
  def parse_nonce_account(raw)
@@ -20,7 +20,7 @@ module Solana::Ruby::Kit
20
20
  T.untyped
21
21
  )
22
22
 
23
- module_function
23
+ extend self
24
24
 
25
25
  sig { params(raw: T::Hash[String, T.untyped]).returns(T.untyped) }
26
26
  def parse_stake_account(raw)
@@ -22,7 +22,7 @@ module Solana::Ruby::Kit
22
22
  T.untyped
23
23
  )
24
24
 
25
- module_function
25
+ extend self
26
26
 
27
27
  sig { params(raw: T::Hash[String, T.untyped]).returns(T.untyped) }
28
28
  def parse_token_account(raw)
@@ -15,7 +15,7 @@ module Solana::Ruby::Kit
15
15
  T.untyped
16
16
  )
17
17
 
18
- module_function
18
+ extend self
19
19
 
20
20
  sig { params(raw: T::Hash[String, T.untyped]).returns(T.untyped) }
21
21
  def parse_vote_account(raw)
@@ -24,7 +24,7 @@ module Solana::Ruby::Kit
24
24
  def to_s = @url
25
25
  end
26
26
 
27
- module_function
27
+ extend self
28
28
 
29
29
  # Wraps a URL string and tags it as mainnet.
30
30
  # Mirrors `mainnet(url)`.
@@ -22,7 +22,7 @@ module Solana::Ruby::Kit
22
22
  T::Array[Symbol]
23
23
  )
24
24
 
25
- module_function
25
+ extend self
26
26
 
27
27
  # Returns a numeric score for a commitment level (higher = more confirmed).
28
28
  # Mirrors `getCommitmentScore()`.
@@ -15,7 +15,7 @@ module Solana::Ruby::Kit
15
15
 
16
16
  LAMPORTS_U64_MAX = T.let(T.unsafe(2**64 - 1), Integer)
17
17
 
18
- module_function
18
+ extend self
19
19
 
20
20
  # Returns true if the integer is a valid u64 lamport value.
21
21
  # Mirrors `isLamports()`.
@@ -55,7 +55,7 @@ module Solana::Ruby::Kit
55
55
  SOL_SCALE = T.let(1_000_000_000, Integer)
56
56
  SOL_RAW_MAX = T.let(Kernel.Integer(2**64 - 1), Integer)
57
57
 
58
- module_function
58
+ extend self
59
59
 
60
60
  # Parses a decimal string and returns a Sol value.
61
61
  # Raises FIXED_POINTS__STRICT_MODE_PRECISION_LOSS if the string has more
@@ -59,7 +59,7 @@ module Solana::Ruby::Kit
59
59
  end
60
60
  end
61
61
 
62
- module_function
62
+ extend self
63
63
 
64
64
  # Creates a KeyPairSigner from an existing Keys::KeyPair.
65
65
  # Mirrors `createSignerFromKeyPair(keyPair)`.
@@ -20,7 +20,7 @@ module Solana::Ruby::Kit
20
20
  # Sentinel value pushed into the queue when the stream is done.
21
21
  DONE = T.let(Object.new.freeze, Object)
22
22
 
23
- module_function
23
+ extend self
24
24
 
25
25
  # @param publisher [DataPublisher]
26
26
  # @param data_channel channel name for data messages
@@ -8,7 +8,7 @@ module Solana::Ruby::Kit
8
8
  module Subscribable
9
9
  extend T::Sig
10
10
 
11
- module_function
11
+ extend self
12
12
 
13
13
  # Adapts a ReactiveStreamStore into an Enumerator, so a *push*-based
14
14
  # reactive store can be driven by *pull*-based code that consumes it with
@@ -191,7 +191,7 @@ module Solana::Ruby::Kit
191
191
  end
192
192
  end
193
193
 
194
- module_function
194
+ extend self
195
195
 
196
196
  # Wraps a callable in a ReactiveActionStore.
197
197
  # fn receives the arguments passed to dispatch/dispatch_async.
@@ -199,7 +199,7 @@ module Solana::Ruby::Kit
199
199
  end
200
200
  end
201
201
 
202
- module_function
202
+ extend self
203
203
 
204
204
  # Creates a ReactiveStreamStore backed by a ready-made DataPublisher.
205
205
  # retry() is not supported — see create_reactive_store_from_data_publisher_factory.
@@ -17,7 +17,7 @@ module Solana::Ruby::Kit
17
17
 
18
18
  CLOCK_SIZE = T.let(40, Integer)
19
19
 
20
- module_function
20
+ extend self
21
21
 
22
22
  sig { params(rpc: Rpc::Client).returns(SysvarClock) }
23
23
  def fetch_sysvar_clock(rpc)
@@ -14,7 +14,7 @@ module Solana::Ruby::Kit
14
14
  const :first_normal_slot, Integer
15
15
  end
16
16
 
17
- module_function
17
+ extend self
18
18
 
19
19
  sig { params(rpc: Rpc::Client).returns(SysvarEpochSchedule) }
20
20
  def fetch_sysvar_epoch_schedule(rpc)
@@ -8,7 +8,7 @@ module Solana::Ruby::Kit
8
8
  const :last_restart_slot, Integer
9
9
  end
10
10
 
11
- module_function
11
+ extend self
12
12
 
13
13
  sig { params(rpc: Rpc::Client).returns(SysvarLastRestartSlot) }
14
14
  def fetch_sysvar_last_restart_slot(rpc)
@@ -11,7 +11,7 @@ module Solana::Ruby::Kit
11
11
  const :burn_percent, Integer
12
12
  end
13
13
 
14
- module_function
14
+ extend self
15
15
 
16
16
  sig { params(rpc: Rpc::Client).returns(SysvarRent) }
17
17
  def fetch_sysvar_rent(rpc)
@@ -11,7 +11,7 @@ module Solana::Ruby::Kit
11
11
  module Sysvars
12
12
  extend T::Sig
13
13
 
14
- module_function
14
+ extend self
15
15
 
16
16
  # Decode base64 account data from an RpcContextualValue returned by
17
17
  # get_account_info(encoding: 'base64').
@@ -10,7 +10,7 @@ module Solana::Ruby::Kit
10
10
  module TransactionConfirmation
11
11
  extend T::Sig
12
12
 
13
- module_function
13
+ extend self
14
14
 
15
15
  # Poll getSignatureStatuses until +signature+ reaches +commitment+ or
16
16
  # the blockheight/timeout deadline is exceeded.
@@ -39,7 +39,7 @@ module Solana::Ruby::Kit
39
39
  const :lifetime_token, String # base58-encoded blockhash or nonce value
40
40
  end
41
41
 
42
- module_function
42
+ extend self
43
43
 
44
44
  # Decodes legacy or v0 compiled transaction message bytes (the
45
45
  # `message_bytes` of a `Transactions::Transaction`) into a
@@ -31,7 +31,7 @@ module Solana::Ruby::Kit
31
31
  const :transaction, T.nilable(Transactions::Transaction)
32
32
  end
33
33
 
34
- module_function
34
+ extend self
35
35
 
36
36
  # Decodes a confirmed-transaction RPC response (any of `encoding: 'base64'`,
37
37
  # `'base58'`, or `'json'`) into a CompiledTransactionMessage plus, for
@@ -10,7 +10,7 @@ module Solana::Ruby::Kit
10
10
  module TransactionIntrospection
11
11
  extend T::Sig
12
12
 
13
- module_function
13
+ extend self
14
14
 
15
15
  # Returns the inner instructions in a transaction `meta` as
16
16
  # TracedInstructions.
@@ -11,7 +11,7 @@ module Solana::Ruby::Kit
11
11
  module TransactionIntrospection
12
12
  extend T::Sig
13
13
 
14
- module_function
14
+ extend self
15
15
 
16
16
  # Builds the full ordered list of AccountMetas for a compiled transaction
17
17
  # message.
@@ -11,7 +11,7 @@ module Solana::Ruby::Kit
11
11
  module TransactionIntrospection
12
12
  extend T::Sig
13
13
 
14
- module_function
14
+ extend self
15
15
 
16
16
  # Returns every instruction in a confirmed transaction as
17
17
  # TracedInstructions, in the order an explorer displays them: each outer
@@ -23,7 +23,7 @@ module Solana::Ruby::Kit
23
23
  SET_COMPUTE_UNIT_LIMIT_DISCRIMINATOR = T.let(2, Integer)
24
24
  SET_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_DISCRIMINATOR = T.let(4, Integer)
25
25
 
26
- module_function
26
+ extend self
27
27
 
28
28
  # ---------------------------------------------------------------------------
29
29
  # SetComputeUnitLimit instruction helpers
@@ -16,7 +16,7 @@ module Solana::Ruby::Kit
16
16
  # A requested heap frame size must be a whole number of KiB.
17
17
  HEAP_SIZE_MULTIPLE_OF = T.let(1024, Integer)
18
18
 
19
- module_function
19
+ extend self
20
20
 
21
21
  # Raises if the given compute unit limit is one the runtime will not honor as written.
22
22
  #
@@ -57,7 +57,7 @@ module Solana::Ruby::Kit
57
57
  const :address_table_lookups, T.nilable(T::Hash[String, T::Array[Integer]])
58
58
  end
59
59
 
60
- module_function
60
+ extend self
61
61
 
62
62
  # Creates an empty transaction message at the given version.
63
63
  # Mirrors `createTransactionMessage({ version })`.
@@ -12,7 +12,7 @@ module Solana::Ruby::Kit
12
12
  # Maximum wire-encoded transaction size in bytes (Solana protocol limit).
13
13
  TRANSACTION_SIZE_LIMIT = T.let(1232, Integer)
14
14
 
15
- module_function
15
+ extend self
16
16
 
17
17
  # Returns the compiled byte-size of a transaction message.
18
18
  # Mirrors `getTransactionMessageSize()` from @solana/transactions.
@@ -174,7 +174,7 @@ module Solana::Ruby::Kit
174
174
  # [message bytes]
175
175
  #
176
176
  # The result is a binary String; base64-encode it before sending via HTTP.
177
- sig { params(transaction: Transaction).returns(String) }
177
+ sig { params(transaction: AnyTransaction).returns(String) }
178
178
  def wire_encode_transaction(transaction)
179
179
  sigs = transaction.signatures
180
180
  header = encode_compact_u16(sigs.size)