solana-web3-on-steroids 1.0.2
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.
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/client/SteroidClient.d.ts +55 -0
- package/dist/client/SteroidClient.js +131 -0
- package/dist/client/SteroidClient.js.map +1 -0
- package/dist/connection/SteroidConnection.d.ts +96 -0
- package/dist/connection/SteroidConnection.js +323 -0
- package/dist/connection/SteroidConnection.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/transaction/SteroidTransaction.d.ts +58 -0
- package/dist/transaction/SteroidTransaction.js +275 -0
- package/dist/transaction/SteroidTransaction.js.map +1 -0
- package/dist/types/SteroidWalletTypes.d.ts +185 -0
- package/dist/types/SteroidWalletTypes.js +56 -0
- package/dist/types/SteroidWalletTypes.js.map +1 -0
- package/dist/wallet/SteroidWallet.d.ts +85 -0
- package/dist/wallet/SteroidWallet.js +270 -0
- package/dist/wallet/SteroidWallet.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { SteroidTransaction } from '../transaction/SteroidTransaction.js';
|
|
2
|
+
import { WalletErrorType } from '../types/SteroidWalletTypes.js';
|
|
3
|
+
export class WalletError extends Error {
|
|
4
|
+
type;
|
|
5
|
+
originalError;
|
|
6
|
+
constructor(type, message, originalError) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.type = type;
|
|
9
|
+
this.originalError = originalError;
|
|
10
|
+
this.name = 'WalletError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* SteroidWallet wraps any Solana wallet adapter and provides:
|
|
15
|
+
* - Normalized error handling across different wallet implementations
|
|
16
|
+
* - Network consistency validation
|
|
17
|
+
* - Automatic transaction retry and confirmation
|
|
18
|
+
* - Graceful degradation for missing wallet features
|
|
19
|
+
*/
|
|
20
|
+
export class SteroidWallet {
|
|
21
|
+
wallet;
|
|
22
|
+
connection;
|
|
23
|
+
txEngine;
|
|
24
|
+
config;
|
|
25
|
+
networkValidated = false;
|
|
26
|
+
genesisHash;
|
|
27
|
+
constructor(wallet, connection, config = {}) {
|
|
28
|
+
this.wallet = wallet;
|
|
29
|
+
this.connection = connection;
|
|
30
|
+
this.txEngine = new SteroidTransaction(connection);
|
|
31
|
+
this.config = {
|
|
32
|
+
validateNetwork: config.validateNetwork ?? true,
|
|
33
|
+
expectedGenesisHash: config.expectedGenesisHash ?? '',
|
|
34
|
+
enableLogging: config.enableLogging ?? false,
|
|
35
|
+
autoRefreshBlockhash: config.autoRefreshBlockhash ?? true,
|
|
36
|
+
maxBlockhashAge: config.maxBlockhashAge ?? 60,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get the wallet's public key.
|
|
41
|
+
*/
|
|
42
|
+
get publicKey() {
|
|
43
|
+
return this.wallet.publicKey;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Signs and sends a transaction with full reliability guarantees.
|
|
47
|
+
* Handles blockhash refresh, retries, and multi-node confirmation.
|
|
48
|
+
*/
|
|
49
|
+
async signAndSend(transaction, options = {}) {
|
|
50
|
+
// Pre-flight checks
|
|
51
|
+
await this.guardState();
|
|
52
|
+
try {
|
|
53
|
+
// Refresh blockhash if needed
|
|
54
|
+
if (this.config.autoRefreshBlockhash && this.isLegacyTransaction(transaction)) {
|
|
55
|
+
await this.ensureFreshBlockhash(transaction);
|
|
56
|
+
}
|
|
57
|
+
// Sign transaction
|
|
58
|
+
this.log('info', 'Requesting signature from wallet...');
|
|
59
|
+
const signedTx = await this.signTransactionSafe(transaction);
|
|
60
|
+
this.log('info', 'Transaction signed successfully');
|
|
61
|
+
// Send with Steroid reliability
|
|
62
|
+
return await this.txEngine.sendAndConfirm(signedTx, {
|
|
63
|
+
enableLogging: this.config.enableLogging,
|
|
64
|
+
...options,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
throw this.normalizeError(error);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Sign a transaction safely with normalized error handling.
|
|
73
|
+
*/
|
|
74
|
+
async signTransaction(transaction) {
|
|
75
|
+
await this.guardState();
|
|
76
|
+
try {
|
|
77
|
+
this.log('info', 'Requesting signature from wallet...');
|
|
78
|
+
const signed = await this.wallet.signTransaction(transaction);
|
|
79
|
+
this.log('info', 'Transaction signed successfully');
|
|
80
|
+
return signed;
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
throw this.normalizeError(error);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Sign multiple transactions safely.
|
|
88
|
+
*/
|
|
89
|
+
async signAllTransactions(transactions) {
|
|
90
|
+
await this.guardState();
|
|
91
|
+
if (transactions.length === 0) {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
this.log('info', `Requesting signatures for ${transactions.length} transactions...`);
|
|
96
|
+
const signed = await this.wallet.signAllTransactions(transactions);
|
|
97
|
+
this.log('info', `Successfully signed ${signed.length} transactions`);
|
|
98
|
+
return signed;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
throw this.normalizeError(error);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Sign a message with standardized error handling.
|
|
106
|
+
*/
|
|
107
|
+
async signMessage(message) {
|
|
108
|
+
await this.guardState();
|
|
109
|
+
const signMessage = this.wallet.signMessage;
|
|
110
|
+
if (!signMessage) {
|
|
111
|
+
throw new WalletError(WalletErrorType.UNSUPPORTED_OPERATION, 'Wallet does not support message signing');
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
this.log('info', 'Requesting message signature from wallet...');
|
|
115
|
+
const signature = await signMessage.call(this.wallet, message);
|
|
116
|
+
this.log('info', 'Message signed successfully');
|
|
117
|
+
return signature;
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
throw this.normalizeError(error);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* System-level state validation before operations.
|
|
125
|
+
*/
|
|
126
|
+
async guardState() {
|
|
127
|
+
// Check wallet connection
|
|
128
|
+
if (!this.wallet.publicKey) {
|
|
129
|
+
throw new WalletError(WalletErrorType.NOT_CONNECTED, 'Wallet is not connected or public key is missing');
|
|
130
|
+
}
|
|
131
|
+
// Validate network if enabled and not yet validated
|
|
132
|
+
if (this.config.validateNetwork && !this.networkValidated) {
|
|
133
|
+
await this.validateNetwork();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Validates that the wallet and connection are on the same network.
|
|
138
|
+
*/
|
|
139
|
+
async validateNetwork() {
|
|
140
|
+
try {
|
|
141
|
+
// Get genesis hash to uniquely identify the network
|
|
142
|
+
const genesisHash = await this.connection.getGenesisHash();
|
|
143
|
+
this.genesisHash = genesisHash;
|
|
144
|
+
this.log('info', `Network validation - Genesis hash: ${genesisHash.slice(0, 16)}...`);
|
|
145
|
+
// If expected genesis hash is configured, verify it matches
|
|
146
|
+
if (this.config.expectedGenesisHash) {
|
|
147
|
+
if (genesisHash !== this.config.expectedGenesisHash) {
|
|
148
|
+
throw new WalletError(WalletErrorType.NETWORK_MISMATCH, `Network mismatch: Expected ${this.config.expectedGenesisHash.slice(0, 16)}..., got ${genesisHash.slice(0, 16)}...`);
|
|
149
|
+
}
|
|
150
|
+
this.log('info', 'Network validation passed - Genesis hash matches expected value');
|
|
151
|
+
}
|
|
152
|
+
this.networkValidated = true;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
if (error instanceof WalletError) {
|
|
156
|
+
throw error;
|
|
157
|
+
}
|
|
158
|
+
this.log('warn', 'Network validation failed:', error.message);
|
|
159
|
+
// Don't throw - some wallets/networks might not support genesis hash
|
|
160
|
+
// Just log and continue
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Ensures transaction has a fresh blockhash.
|
|
165
|
+
*/
|
|
166
|
+
async ensureFreshBlockhash(transaction) {
|
|
167
|
+
if (!transaction.recentBlockhash) {
|
|
168
|
+
// No blockhash set, fetch a fresh one
|
|
169
|
+
const { blockhash, lastValidBlockHeight } = await this.connection.getLatestBlockhash('confirmed');
|
|
170
|
+
transaction.recentBlockhash = blockhash;
|
|
171
|
+
transaction.lastValidBlockHeight = lastValidBlockHeight;
|
|
172
|
+
this.log('info', 'Set fresh blockhash on transaction');
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
// Check if existing blockhash might be stale
|
|
176
|
+
// Note: This is a best-effort check - we can't know the exact age
|
|
177
|
+
// The transaction layer will refresh if needed during retry
|
|
178
|
+
this.log('info', 'Transaction already has blockhash, will validate during send');
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Safely sign a transaction with proper error handling.
|
|
182
|
+
*/
|
|
183
|
+
async signTransactionSafe(transaction) {
|
|
184
|
+
try {
|
|
185
|
+
return await this.wallet.signTransaction(transaction);
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
throw this.normalizeError(error);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Normalizes different wallet errors into a consistent format.
|
|
193
|
+
*/
|
|
194
|
+
normalizeError(error) {
|
|
195
|
+
if (error instanceof WalletError) {
|
|
196
|
+
return error;
|
|
197
|
+
}
|
|
198
|
+
const message = error.message?.toLowerCase() || '';
|
|
199
|
+
const code = error.code || error.name || '';
|
|
200
|
+
// User rejection patterns
|
|
201
|
+
if (message.includes('user rejected') ||
|
|
202
|
+
message.includes('user denied') ||
|
|
203
|
+
message.includes('user cancelled') ||
|
|
204
|
+
message.includes('rejected by user') ||
|
|
205
|
+
code === 'USER_REJECTED' ||
|
|
206
|
+
code === 4001 // EIP-1193 user rejection
|
|
207
|
+
) {
|
|
208
|
+
return new WalletError(WalletErrorType.USER_REJECTED, 'User rejected the request', error);
|
|
209
|
+
}
|
|
210
|
+
// Connection issues
|
|
211
|
+
if (message.includes('not connected') ||
|
|
212
|
+
message.includes('wallet not found') ||
|
|
213
|
+
message.includes('no wallet')) {
|
|
214
|
+
return new WalletError(WalletErrorType.NOT_CONNECTED, 'Wallet is not connected', error);
|
|
215
|
+
}
|
|
216
|
+
// Signing failures
|
|
217
|
+
if (message.includes('signing failed') ||
|
|
218
|
+
message.includes('signature failed') ||
|
|
219
|
+
message.includes('failed to sign')) {
|
|
220
|
+
return new WalletError(WalletErrorType.SIGNING_FAILED, `Signing failed: ${error.message}`, error);
|
|
221
|
+
}
|
|
222
|
+
// Default to unknown with original error preserved
|
|
223
|
+
return new WalletError(WalletErrorType.UNKNOWN, error.message || 'Unknown wallet error', error);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Type guard for legacy transactions.
|
|
227
|
+
*/
|
|
228
|
+
isLegacyTransaction(transaction) {
|
|
229
|
+
return 'recentBlockhash' in transaction;
|
|
230
|
+
}
|
|
231
|
+
log(level, ...args) {
|
|
232
|
+
if (!this.config.enableLogging)
|
|
233
|
+
return;
|
|
234
|
+
const prefix = '[SteroidWallet]';
|
|
235
|
+
switch (level) {
|
|
236
|
+
case 'info':
|
|
237
|
+
console.log(prefix, ...args);
|
|
238
|
+
break;
|
|
239
|
+
case 'warn':
|
|
240
|
+
console.warn(prefix, ...args);
|
|
241
|
+
break;
|
|
242
|
+
case 'error':
|
|
243
|
+
console.error(prefix, ...args);
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Get network information.
|
|
249
|
+
*/
|
|
250
|
+
getNetworkInfo() {
|
|
251
|
+
return {
|
|
252
|
+
genesisHash: this.genesisHash,
|
|
253
|
+
validated: this.networkValidated,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Force re-validation of network on next operation.
|
|
258
|
+
*/
|
|
259
|
+
invalidateNetwork() {
|
|
260
|
+
this.networkValidated = false;
|
|
261
|
+
this.log('info', 'Network validation invalidated, will re-validate on next operation');
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Check if wallet supports message signing.
|
|
265
|
+
*/
|
|
266
|
+
supportsMessageSigning() {
|
|
267
|
+
return typeof this.wallet.signMessage === 'function';
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=SteroidWallet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SteroidWallet.js","sourceRoot":"","sources":["../../src/wallet/SteroidWallet.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAEL,eAAe,EAGhB,MAAM,gCAAgC,CAAC;AAExC,MAAM,OAAO,WAAY,SAAQ,KAAK;IAE3B;IAEA;IAHT,YACS,IAAqB,EAC5B,OAAe,EACR,aAAmB;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,SAAI,GAAJ,IAAI,CAAiB;QAErB,kBAAa,GAAb,aAAa,CAAM;QAG1B,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,aAAa;IAChB,MAAM,CAAkB;IACxB,UAAU,CAAoB;IAC9B,QAAQ,CAAqB;IAC7B,MAAM,CAAgC;IACtC,gBAAgB,GAAY,KAAK,CAAC;IAClC,WAAW,CAAU;IAE7B,YACE,MAAuB,EACvB,UAA6B,EAC7B,SAA8B,EAAE;QAEhC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM,GAAG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,KAAK,UAAU,CAAC;IACvD,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "solana-web3-on-steroids",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "A systems-grade resilience layer for Solana web3.js",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "Connor",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"solana",
|
|
12
|
+
"web3",
|
|
13
|
+
"blockchain",
|
|
14
|
+
"resilience",
|
|
15
|
+
"transaction",
|
|
16
|
+
"rpc"
|
|
17
|
+
],
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc",
|
|
25
|
+
"lint": "tsc --noEmit",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
28
|
+
"test:coverage": "vitest run --coverage"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@solana/web3.js": "^1.98.4"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@solana/wallet-adapter-base": "^0.9.23",
|
|
35
|
+
"@solana/wallet-adapter-react": "^0.15.35",
|
|
36
|
+
"@solana/wallet-adapter-wallets": "^0.19.32",
|
|
37
|
+
"@types/node": "^20.0.0",
|
|
38
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
39
|
+
"ts-node": "^10.9.1",
|
|
40
|
+
"typescript": "^5.0.0",
|
|
41
|
+
"vitest": "^4.0.18"
|
|
42
|
+
}
|
|
43
|
+
}
|