module Solana::Utils

The Utils module provides utility methods and constants for interacting with the Solana blockchain.

Constants

PACKET_DATA_SIZE

The maximum packet data size for Solana transactions.

SYSTEM_PROGRAM_ID

The system program ID for Solana.

Public Class Methods

base58_decode(base58) click to toggle source

Decodes a Base58 string into a byte array.

@param [String] base58 The Base58 string to decode. @return [String] The decoded byte array.

# File lib/solana-ruby/utils.rb, line 84
def self.base58_decode(base58)
  Base58.base58_to_binary(base58, :bitcoin)
end
base58_encode(bytes) click to toggle source

Encodes a byte array into a Base58 string.

@param [String] bytes The byte array to encode. @return [String] The Base58-encoded string.

# File lib/solana-ruby/utils.rb, line 75
def self.base58_encode(bytes)
  Base58.binary_to_base58(bytes, :bitcoin)
end
base64_decode(base64) click to toggle source

Decodes a Base64 string into a byte array.

@param [String] base64 The Base64 string to decode. @return [String] The decoded byte array.

# File lib/solana-ruby/utils.rb, line 102
def self.base64_decode(base64)
  Base64.strict_decode64(base64)
end
base64_encode(bytes) click to toggle source

Encodes a byte array into a Base64 string.

@param [String] bytes The byte array to encode. @return [String] The Base64-encoded string.

# File lib/solana-ruby/utils.rb, line 93
def self.base64_encode(bytes)
  Base64.strict_encode64(bytes)
end