@tuwaio/orbit-solana 0.2.2 → 0.2.4
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/README.md +5 -11
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Built with **TypeScript**, this package utilizes **`gill`** (an improvement laye
|
|
|
18
18
|
|
|
19
19
|
## ✨ Key Features
|
|
20
20
|
|
|
21
|
-
- **RPC Client Management:** Efficiently creates and caches Solana RPC clients (`SolanaClient` and lower-level `
|
|
21
|
+
- **RPC Client Management:** Efficiently creates and caches Solana RPC clients (`SolanaClient` and lower-level `RPC`) using `gill` (`createSolanaClientWithCache`, `createSolanaRPC`). Supports default and custom RPC URLs.
|
|
22
22
|
- **Wallet Standard Integration:** Discovers available Solana wallets compatible with the Wallet Standard (`getAvailableSolanaConnectors`). Retrieves the currently connected wallet based on stored address (`getConnectedSolanaConnector`).
|
|
23
23
|
- **Account Info Resolution:** Fetches user-set account labels (names) and icons (avatars) directly from the connected wallet's accounts (`getSolanaAddressName`, `getSolanaAddressAvatar`), including caching.
|
|
24
24
|
- **Cluster & RPC URL Helpers:** Utilities to parse cluster names (e.g., 'mainnet', 'devnet') from chain IDs and retrieve corresponding RPC URLs (`getCluster`, `getRpcUrlForCluster`).
|
|
@@ -32,19 +32,13 @@ Built with **TypeScript**, this package utilizes **`gill`** (an improvement laye
|
|
|
32
32
|
|
|
33
33
|
### Requirements
|
|
34
34
|
|
|
35
|
-
- Node.js 20
|
|
35
|
+
- Node.js 20-24
|
|
36
36
|
- TypeScript 5.9+
|
|
37
37
|
- `@tuwaio/orbit-core` (as a foundational peer dependency)
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
# Using pnpm (recommended)
|
|
40
|
+
# Using pnpm (recommended), but you can use npm, yarn or bun as well
|
|
41
41
|
pnpm add @tuwaio/orbit-solana @tuwaio/orbit-core gill @wallet-standard/app @wallet-standard/ui-core @wallet-standard/ui-registry
|
|
42
|
-
|
|
43
|
-
# Using npm
|
|
44
|
-
npm install @tuwaio/orbit-solana @tuwaio/orbit-core gill @wallet-standard/app @wallet-standard/ui-core @wallet-standard/ui-registry
|
|
45
|
-
|
|
46
|
-
# Using yarn
|
|
47
|
-
yarn add @tuwaio/orbit-solana @tuwaio/orbit-core gill @wallet-standard/app @wallet-standard/ui-core @wallet-standard/ui-registry
|
|
48
42
|
````
|
|
49
43
|
|
|
50
44
|
*Note: `@tuwaio/orbit-core`, `gill`, `@wallet-standard/app`, `@wallet-standard/ui-core`, and `@wallet-standard/ui-registry` are **peer dependencies** and must be installed alongside `@tuwaio/orbit-solana`*.
|
|
@@ -62,7 +56,7 @@ import { getAvailableWallets } from '@tuwaio/orbit-solana';
|
|
|
62
56
|
|
|
63
57
|
const wallets = getAvailableWallets();
|
|
64
58
|
console.log('Available Solana Wallets:', wallets.map(w => w.name));
|
|
65
|
-
// Example Output: ['Phantom', '
|
|
59
|
+
// Example Output: ['Phantom', 'MetaMask', ...]
|
|
66
60
|
```
|
|
67
61
|
|
|
68
62
|
### Create a Cached RPC Client
|
|
@@ -142,7 +136,7 @@ console.log(devnetExplorerUrl);
|
|
|
142
136
|
|
|
143
137
|
- **Types (`types.ts`)**: Defines Solana-specific types like `SolanaRPCUrls`.
|
|
144
138
|
- **Cluster Helpers (`clusterHelpers.ts`)**: Functions `getCluster` and `getRpcUrlForCluster` for managing Solana network identifiers and RPC endpoints.
|
|
145
|
-
- **Client Creation (`createSolanaClientWithCache.ts`, `createSolanaRPC.ts`)**: Provides cached instances of `gill`'s `SolanaClient` and `
|
|
139
|
+
- **Client Creation (`createSolanaClientWithCache.ts`, `createSolanaRPC.ts`)**: Provides cached instances of `gill`'s `SolanaClient` and `RPC`. Includes default RPC URLs.
|
|
146
140
|
- **Wallet Interaction (`getAvailableSolanaConnectors.ts`, `getConnectedSolanaConnector.ts`)**: Leverages `@wallet-standard` to find and identify Solana wallets.
|
|
147
141
|
- **Account Info (`getSolanaAddressAvatar.ts`, `getSolanaAddressName.ts`)**: Retrieves metadata (label, icon) associated with accounts within the connected wallet.
|
|
148
142
|
- **Explorer Links (`getSolanaExplorerLink.ts`)**: Utility for constructing explorer URLs.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tuwaio/orbit-solana",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Oleksandr Tkach",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"tsup": "^8.5.1",
|
|
47
|
-
"typescript": "^
|
|
47
|
+
"typescript": "^6.0.3",
|
|
48
48
|
"gill": "^0.14.0",
|
|
49
49
|
"@wallet-standard/app": "^1.1.0",
|
|
50
50
|
"@wallet-standard/ui-core": "^1.0.0",
|
|
51
51
|
"@wallet-standard/ui-registry": "^1.0.1",
|
|
52
|
-
"@tuwaio/orbit-core": "^0.2.
|
|
52
|
+
"@tuwaio/orbit-core": "^0.2.8"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"start": "tsup src/index.ts --watch",
|