solace 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG +42 -23
- data/lib/solace/connection.rb +4 -2
- data/lib/solace/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9bca105aef6d20a1a5b6d5dc6b2fce8c7a8523c9a2a24afd3ad15bf36efbb55
|
|
4
|
+
data.tar.gz: e6a70370368a4822249bf7c912f70f54a02ce5389ef128e40acdc769b315ebae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 44fc38f19753ed736c05e1ba58bc7799fbe96d736553e3df220cfa38cae60a0dc2d2ecb3459990300efc108d56b9ec0ae8ce4fc552c39b31cf668e54878f52bd
|
|
7
|
+
data.tar.gz: 4ffe860837dc85e925f308fdff68129ba01cdc41fb192495af4926bbd91328c62847f862c2847a819c9615cd1b223d512910a421713ee64f9b038bee25def482
|
data/CHANGELOG
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# Change Log
|
|
2
|
+
|
|
2
3
|
All notable changes to this project will be documented in this file.
|
|
3
4
|
|
|
4
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
@@ -9,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
9
10
|
## [VERSION] - yyyy-mm-dd
|
|
10
11
|
|
|
11
12
|
### Added
|
|
13
|
+
|
|
12
14
|
1.
|
|
13
15
|
|
|
14
16
|
### Changed
|
|
@@ -20,6 +22,12 @@ Got it — here’s your changelog tidied up for clarity and consistency without
|
|
|
20
22
|
|
|
21
23
|
---
|
|
22
24
|
|
|
25
|
+
## [0.1.1] - 2025-05-11
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
1. Added support to inject encoding externally to get the data with respective encoding.
|
|
30
|
+
|
|
23
31
|
## [0.1.0] - 2025-18-10
|
|
24
32
|
|
|
25
33
|
**NOTE (Breaking):**
|
|
@@ -30,8 +38,8 @@ Additionally, unless explicitly required by a composer’s instruction, the `pay
|
|
|
30
38
|
|
|
31
39
|
1. **`Solace::Tokens`** — a structured registry and lookup system for Solana token metadata.
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
- Developers can define token details via a YAML configuration file scoped by network (e.g., `mainnet`, `devnet`).
|
|
42
|
+
- Programmatic access to token metadata:
|
|
35
43
|
|
|
36
44
|
```ruby
|
|
37
45
|
Solace::Tokens.load(path: 'tokens.yml', network: :devnet)
|
|
@@ -39,49 +47,50 @@ Additionally, unless explicitly required by a composer’s instruction, the `pay
|
|
|
39
47
|
Solace::Tokens.fetch('USDC') # => <Solace::Tokens::Token ...>
|
|
40
48
|
Solace::Tokens.where(decimals: 6)
|
|
41
49
|
```
|
|
42
|
-
|
|
43
|
-
|
|
50
|
+
|
|
51
|
+
- Dynamically registers constants for each token symbol (`USDC`, `SOL`, etc.).
|
|
52
|
+
- Safety improvements to preserve internal constants (`Token`) during reloads.
|
|
44
53
|
|
|
45
54
|
2. **`SystemProgramCreateAccountComposer`** — composer for building account creation flows via the Solana System Program.
|
|
46
55
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
- Wraps `SystemProgram::CreateAccountInstruction`.
|
|
57
|
+
- Handles lamport allocation, rent exemption, and ownership assignment.
|
|
58
|
+
- Simplifies creation of system-owned and program-owned accounts.
|
|
50
59
|
|
|
51
60
|
3. **`SplTokenProgramInitializeMintComposer`** — composer for initializing new SPL Token mints.
|
|
52
61
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
- Wraps `SplToken::InitializeMintInstruction`.
|
|
63
|
+
- Supports decimals, mint authority, and optional freeze authority.
|
|
64
|
+
- Designed to pair with `SystemProgramCreateAccountComposer` for one-transaction mint creation.
|
|
56
65
|
|
|
57
66
|
4. **`SplTokenProgramMintToComposer`** — composer for minting tokens to an ATA.
|
|
58
67
|
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
- Wraps `SplToken::MintToInstruction`.
|
|
69
|
+
- Supports minting tokens to a destination ATA.
|
|
61
70
|
|
|
62
71
|
5. **`SplTokenProgramTransferComposer`** — composer for transferring tokens.
|
|
63
72
|
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
- Wraps `SplToken::TransferInstruction`.
|
|
74
|
+
- Supports sending SPL tokens.
|
|
66
75
|
|
|
67
76
|
6. **`Solace::Connection`** — cached blockhash accessors.
|
|
68
77
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
- Added `last_fetched_blockhash` and `last_fetched_block_height`.
|
|
79
|
+
- Stores the most recently retrieved blockhash and corresponding `lastValidBlockHeight`.
|
|
80
|
+
- Enables reuse without re-fetching between sequential transactions.
|
|
81
|
+
- `get_latest_blockhash` now sets these values automatically.
|
|
73
82
|
|
|
74
83
|
7. **`TransactionComposer`** — instruction ordering helpers.
|
|
75
84
|
|
|
76
|
-
|
|
85
|
+
- Added `prepend_instruction` and `insert_instruction` for finer control of instruction order.
|
|
77
86
|
|
|
78
87
|
8. **`Transaction`** — signature helper.
|
|
79
88
|
|
|
80
|
-
|
|
89
|
+
- Added `transaction.signature` to get the signature from a signed transaction.
|
|
81
90
|
|
|
82
91
|
9. **Program method options** — higher-level control.
|
|
83
92
|
|
|
84
|
-
|
|
93
|
+
- Added `execute`, `sign`, and a yield block to relevant Program methods for flow control and composer access.
|
|
85
94
|
|
|
86
95
|
### Changed
|
|
87
96
|
|
|
@@ -105,23 +114,26 @@ Additionally, unless explicitly required by a composer’s instruction, the `pay
|
|
|
105
114
|
|
|
106
115
|
### Fixed
|
|
107
116
|
|
|
108
|
-
|
|
117
|
+
- Improved token loading safety in `Solace::Tokens` to prevent internal constant removal during reloads.
|
|
109
118
|
|
|
110
119
|
---
|
|
111
120
|
|
|
112
121
|
## [0.0.9] - 2025-08-12
|
|
113
122
|
|
|
114
123
|
### Added
|
|
124
|
+
|
|
115
125
|
1. Added `get_program_accounts` to `Solace::Connection`.
|
|
116
126
|
|
|
117
127
|
### Changed
|
|
118
128
|
|
|
119
129
|
### Fixed
|
|
130
|
+
|
|
120
131
|
1. Removed use of the `try` method for supporting non-rails environments.
|
|
121
132
|
|
|
122
133
|
## [0.0.8] - 2025-08-11
|
|
123
134
|
|
|
124
135
|
### Added
|
|
136
|
+
|
|
125
137
|
1. Added `load` method to `Solace::Constants` to load constants from a YAML file. This method allows for loading constants from a YAML file (i.e. custom program addresses and mint accounts).
|
|
126
138
|
2. Added `to_s` and `address` method to `Solace::Keypair` and `Solace::PublicKey` to return the public key as a Base58 string.
|
|
127
139
|
3. Added `get_signature_status` and `get_signature_statuses` to `Solace::Connection`.
|
|
@@ -129,18 +141,22 @@ Additionally, unless explicitly required by a composer’s instruction, the `pay
|
|
|
129
141
|
5. Added `Errors` module to `Solace::Utils` to handle errors from the HTTP requests made to the Solana RPC node.
|
|
130
142
|
|
|
131
143
|
### Changed
|
|
144
|
+
|
|
132
145
|
1. All methods that take a `Solace::Keypair` or `Solace::Pubkey` where an address is needed now also accept a plain string address. This prevents the need of creating instances of the classes when all that is needed is the address. This is with the exception of the low-level instruction builders, which only expect the correct data and indicies with no required casting.
|
|
133
146
|
2. Changed `wait_for_confirmed_signature` method to accept a `timeout`, `interval`, and `commitment` arguments.
|
|
134
147
|
|
|
135
148
|
### Fixed
|
|
149
|
+
|
|
136
150
|
1. Fixed `get_or_create_address` method in `Solace::Programs::AssociatedTokenAccount` to return the address of the associated token account if it already exists by checking if there is any data at the address.
|
|
137
151
|
|
|
138
152
|
## [0.0.7] - 2025-08-09
|
|
139
153
|
|
|
140
154
|
### Added
|
|
155
|
+
|
|
141
156
|
1. Added `AssociatedTokenAccountProgramCreateAccountComposer` with tests.
|
|
142
157
|
|
|
143
158
|
### Changed
|
|
159
|
+
|
|
144
160
|
1. Updated `AssociatedTokenAccount` to use `AssociatedTokenAccountProgramCreateAccountComposer` and sign the transaction in the `create_associated_token_account` method instead of the `compose_create_associated_token_account` method.
|
|
145
161
|
|
|
146
162
|
### Fixed
|
|
@@ -148,20 +164,23 @@ Additionally, unless explicitly required by a composer’s instruction, the `pay
|
|
|
148
164
|
## [0.0.6] - 2025-08-07
|
|
149
165
|
|
|
150
166
|
### Added
|
|
167
|
+
|
|
151
168
|
1. Added `from_address` method to `Solace::PublicKey`.
|
|
152
169
|
2. Change docs on most methods to include an `@example` section.
|
|
153
170
|
|
|
154
171
|
### Changed
|
|
172
|
+
|
|
155
173
|
1. Change `private_key` method on Keypair to `pivate_key_bytes`
|
|
156
174
|
2. Change README to include a practical example of using composers.
|
|
157
175
|
|
|
158
176
|
### Fixed
|
|
159
|
-
1. Fix `encode_signatures` method in `Solace::Serializers::TransactionSerializer` to correctly count the number of signatures using the `num_required_signatures` field in the message.
|
|
160
177
|
|
|
178
|
+
1. Fix `encode_signatures` method in `Solace::Serializers::TransactionSerializer` to correctly count the number of signatures using the `num_required_signatures` field in the message.
|
|
161
179
|
|
|
162
180
|
## [0.0.3] - 2025-07-30
|
|
163
181
|
|
|
164
182
|
### Added
|
|
183
|
+
|
|
165
184
|
1. Moved `TransferCheckedInstruction` and `TransferInstruction` to `Solace::Instructions::SystemProgram` namespace.
|
|
166
185
|
2. Added `get_token_account_balance` to `Solace::Connection`.
|
|
167
186
|
3. Added `get_or_create_address` to `Solace::Programs::AssociatedTokenAccount`.
|
data/lib/solace/connection.rb
CHANGED
|
@@ -55,11 +55,13 @@ module Solace
|
|
|
55
55
|
# @return [Solace::Connection] The connection object
|
|
56
56
|
# @param [Integer] http_open_timeout The timeout for opening an HTTP connection
|
|
57
57
|
# @param [Integer] http_read_timeout The timeout for reading an HTTP response
|
|
58
|
+
# @param [String] encoding The encoding for the RPC requests
|
|
58
59
|
def initialize(
|
|
59
60
|
rpc_url = 'http://localhost:8899',
|
|
60
61
|
commitment: 'processed',
|
|
61
62
|
http_open_timeout: 30,
|
|
62
|
-
http_read_timeout: 60
|
|
63
|
+
http_read_timeout: 60,
|
|
64
|
+
encoding: 'base64'
|
|
63
65
|
)
|
|
64
66
|
# Initialize the RPC client
|
|
65
67
|
@rpc_client = Utils::RPCClient.new(
|
|
@@ -71,7 +73,7 @@ module Solace
|
|
|
71
73
|
# Set default options for rpc requests
|
|
72
74
|
@default_options = {
|
|
73
75
|
commitment: commitment,
|
|
74
|
-
encoding:
|
|
76
|
+
encoding: encoding
|
|
75
77
|
}
|
|
76
78
|
end
|
|
77
79
|
|
data/lib/solace/version.rb
CHANGED