@vue-solana/core 2.6.1 → 3.0.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.
Files changed (58) hide show
  1. package/README.md +6 -4
  2. package/dist/errors.d.mts +1 -1
  3. package/dist/errors.d.ts +1 -1
  4. package/dist/index.d.mts +4 -2
  5. package/dist/index.d.ts +4 -2
  6. package/dist/index.mjs +6 -11
  7. package/dist/ios-wallet.mjs +1 -4
  8. package/dist/kit.d.mts +1 -1
  9. package/dist/kit.d.ts +1 -1
  10. package/dist/kit.mjs +4 -4
  11. package/dist/mobile-wallet-support.d.mts +3 -0
  12. package/dist/mobile-wallet-support.d.ts +3 -0
  13. package/dist/mobile-wallet-support.mjs +5 -0
  14. package/dist/mobile-wallet.d.mts +2 -2
  15. package/dist/mobile-wallet.d.ts +2 -2
  16. package/dist/mobile-wallet.mjs +1 -9
  17. package/dist/rpc.mjs +0 -2
  18. package/dist/shared/{core.CDVW-ApZ.mjs → core.DJsPYgx_.mjs} +89 -36
  19. package/dist/shared/{core.TqudP0hB.mjs → core.DaUlAmcN.mjs} +15 -22
  20. package/dist/timeout.mjs +3 -0
  21. package/dist/wallet-standard.mjs +1 -5
  22. package/dist/wallet.mjs +26 -39
  23. package/package.json +22 -35
  24. package/dist/action.cjs +0 -14
  25. package/dist/action.d.cts +0 -28
  26. package/dist/address.cjs +0 -33
  27. package/dist/address.d.cts +0 -16
  28. package/dist/buffer-polyfill.cjs +0 -12
  29. package/dist/buffer-polyfill.d.cts +0 -7
  30. package/dist/clusters.cjs +0 -37
  31. package/dist/clusters.d.cts +0 -10
  32. package/dist/errors.cjs +0 -50
  33. package/dist/errors.d.cts +0 -17
  34. package/dist/index.cjs +0 -94
  35. package/dist/index.d.cts +0 -19
  36. package/dist/ios-wallet.cjs +0 -17
  37. package/dist/ios-wallet.d.cts +0 -62
  38. package/dist/kit.cjs +0 -88
  39. package/dist/kit.d.cts +0 -3
  40. package/dist/mobile-wallet.cjs +0 -69
  41. package/dist/mobile-wallet.d.cts +0 -20
  42. package/dist/rpc.cjs +0 -20
  43. package/dist/rpc.d.cts +0 -7
  44. package/dist/shared/core.C9vxHRXl.d.cts +0 -193
  45. package/dist/shared/core.CasnoavM.cjs +0 -323
  46. package/dist/shared/core.eIBHqmLq.cjs +0 -598
  47. package/dist/timeout.cjs +0 -32
  48. package/dist/timeout.d.cts +0 -4
  49. package/dist/token-accounts.cjs +0 -72
  50. package/dist/token-accounts.d.cts +0 -36
  51. package/dist/transaction.cjs +0 -81
  52. package/dist/transaction.d.cts +0 -18
  53. package/dist/types.cjs +0 -2
  54. package/dist/types.d.cts +0 -3
  55. package/dist/wallet-standard.cjs +0 -17
  56. package/dist/wallet-standard.d.cts +0 -22
  57. package/dist/wallet.cjs +0 -81
  58. package/dist/wallet.d.cts +0 -25
package/README.md CHANGED
@@ -9,7 +9,7 @@ Framework-agnostic Solana primitives for Vue Solana libraries and apps that want
9
9
 
10
10
  Use this package directly when you want Kit RPC client helpers, shared wallet types, Android Mobile Wallet Adapter registration helpers, message signing support, token account reads, and transaction helpers without installing the Vue plugin.
11
11
 
12
- `@vue-solana/core` builds on `@solana/kit`. It exposes `createSolanaClient()` and re-exports Kit primitives (`address`, `lamports`, and the `Address`, `Commitment`, `Lamports`, `Rpc`, `Signature`, and `SolanaRpcApi` types) from `@vue-solana/core/kit`. The legacy `@solana/web3-compat` surface and the `web3` subpaths were removed in v2.0.0; transactions flow through the packages as raw `Uint8Array` wire bytes.
12
+ `@vue-solana/core` builds on `@solana/kit`. It exposes `createSolanaClient()` and re-exports all of `@solana/kit` from `@vue-solana/core/kit`. The legacy `@solana/web3-compat` surface and the `web3` subpaths were removed in v2.0.0; transactions flow through the packages as raw `Uint8Array` wire bytes.
13
13
 
14
14
  Official Solana docs:
15
15
 
@@ -42,11 +42,13 @@ Full Vue Solana docs:
42
42
 
43
43
  | Requirement | Supported |
44
44
  | ------------- | ----------------------------------------------------------------- |
45
- | Runtime | Modern ESM or CommonJS bundlers |
45
+ | Runtime | ESM only (modern bundlers; Node needs ESM) |
46
46
  | TypeScript | TypeScript 5.x recommended |
47
- | Solana client | `@solana/kit@^8.3.0` (and `@solana/kit-plugin-rpc`) |
47
+ | Solana client | `@solana/kit@^8.4.0` (and `@solana/kit-plugin-rpc`) |
48
48
  | Clusters | `mainnet` (alias `mainnet-beta`), `devnet`, `testnet`, `localnet` |
49
49
 
50
+ Since v3.0.0 this package is ESM only: there is no `require` export condition and no top-level `main`, so `require("@vue-solana/core")` fails with `No "exports" main defined`. Pin to `@vue-solana/core@^2` if you must stay on CommonJS.
51
+
50
52
  This package no longer depends on `@solana/web3-compat`. It depends on `@solana/kit` and `@solana/kit-plugin-rpc`, so apps do not need to install either directly for normal Vue Solana usage.
51
53
 
52
54
  ## Install
@@ -226,7 +228,7 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
226
228
 
227
229
  - Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
228
230
  - Use `mainnet` for Solana mainnet. This is Solana's official mainnet cluster name; the legacy `mainnet-beta` spelling is still accepted and redirects to the same endpoint.
229
- - Transactions are raw wire bytes. Build transaction messages with `@solana/kit` (`createTransactionMessage()`, `compileTransaction()`) and serialize them before passing them to wallet flows.
231
+ - Transactions are raw wire bytes. Build transaction messages with `@vue-solana/core/kit` (`createTransactionMessage()`, `compileTransaction()`) and serialize them before passing them to wallet flows.
230
232
  - v2.0.0 removed `@solana/web3-compat` and the `web3` subpaths. See the [Kit Migration guide](https://vue-solana-docs.vercel.app/guides/kit-migration) for migrating from v1.
231
233
  - Desktop native app wallets are planned but not implemented yet.
232
234
 
package/dist/errors.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- type SolanaErrorCode = "NO_WALLET_SELECTED" | "WALLET_NOT_CONNECTED" | "WALLET_FEATURE_UNSUPPORTED" | "USER_REJECTED" | "INVALID_ADDRESS" | "TRANSACTION_TIMEOUT" | "RPC_FAILURE" | "STORAGE_FAILURE";
1
+ type SolanaErrorCode = "NO_WALLET_SELECTED" | "WALLET_NOT_CONNECTED" | "WALLET_FEATURE_UNSUPPORTED" | "USER_REJECTED" | "INVALID_ADDRESS" | "TRANSACTION_TIMEOUT" | "RPC_FAILURE" | "STORAGE_FAILURE" | "INVALID_INPUT" | "DECRYPTION_FAILED";
2
2
  interface SolanaErrorOptions {
3
3
  cause?: unknown;
4
4
  feature?: string;
package/dist/errors.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- type SolanaErrorCode = "NO_WALLET_SELECTED" | "WALLET_NOT_CONNECTED" | "WALLET_FEATURE_UNSUPPORTED" | "USER_REJECTED" | "INVALID_ADDRESS" | "TRANSACTION_TIMEOUT" | "RPC_FAILURE" | "STORAGE_FAILURE";
1
+ type SolanaErrorCode = "NO_WALLET_SELECTED" | "WALLET_NOT_CONNECTED" | "WALLET_FEATURE_UNSUPPORTED" | "USER_REJECTED" | "INVALID_ADDRESS" | "TRANSACTION_TIMEOUT" | "RPC_FAILURE" | "STORAGE_FAILURE" | "INVALID_INPUT" | "DECRYPTION_FAILED";
2
2
  interface SolanaErrorOptions {
3
3
  cause?: unknown;
4
4
  feature?: string;
package/dist/index.d.mts CHANGED
@@ -5,15 +5,17 @@ export { AddressInput, MaybeAddressInput, parseAddress } from './address.mjs';
5
5
  export { installSolanaBufferPolyfill } from './buffer-polyfill.mjs';
6
6
  export { SolanaError, SolanaErrorCode, SolanaErrorOptions, createSolanaError, isSolanaError, normalizeSolanaError } from './errors.mjs';
7
7
  export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, b as SolanaClient, c as SolanaCluster, d as SolanaConfig, e as SolanaContext, f as SolanaSignInAccount, g as SolanaSignInInput, h as SolanaSignInResult, i as SolanaSignMessageResult, j as SolanaTransaction, k as SolanaWallet, l as SolanaWalletInfo, T as TransactionConfirmation, m as TransactionStatus, n as createSolanaClient } from './shared/core.C9vxHRXl.mjs';
8
- export { RegisterSolanaMobileWalletOptions, SolanaMobileWalletAppIdentity, getDefaultMobileWalletAppIdentity, isSolanaMobileWalletSupported, registerSolanaMobileWallet } from './mobile-wallet.mjs';
8
+ export { RegisterSolanaMobileWalletOptions, SolanaMobileWalletAppIdentity, getDefaultMobileWalletAppIdentity, registerSolanaMobileWallet } from './mobile-wallet.mjs';
9
9
  export { createSolanaContext } from './rpc.mjs';
10
10
  export { TokenAccountInfo, TokenAccountsByOwnerOptions, TokenBalanceResult, getTokenAccount, getTokenAccountsByOwner, getTokenBalance } from './token-accounts.mjs';
11
11
  export { confirmTransactionSignature, signAndSendTransaction } from './transaction.mjs';
12
12
  export { withSolanaTimeout, withTimeout } from './timeout.mjs';
13
13
  export { SolanaWalletError, SolanaWalletErrorCode, assertWalletCanSign, assertWalletCanSignAndSendTransactions, assertWalletCanSignIn, assertWalletCanSignMessage, assertWalletCanSignTransactions, assertWalletConnected, createNoWalletSelectedError, isWalletConnected } from './wallet.mjs';
14
- export { AccountRole, Address, ClientWithIdentity, ClientWithPayer, ClientWithSubscribeToIdentity, ClientWithSubscribeToPayer, ClientWithTransactionPlanning, ClientWithTransactionSending, Commitment, CreateReactiveStoreWithInitialValueAndSlotTrackingConfig, Instruction, InstructionPlanInput, Lamports, ReactiveActionSource, ReactiveActionState, ReactiveActionStatus, ReactiveActionStore, ReactiveState, ReactiveStreamSource, ReactiveStreamStore, Rpc, Signature, SingleTransactionPlan, SolanaRpcApi, SolanaRpcResponse, SuccessfulSingleTransactionPlanResult, TransactionMessage, TransactionPlan, TransactionPlanInput, TransactionPlanResult, TransactionSigner, address, appendTransactionMessageInstruction, compileTransaction, createReactiveActionStore, createReactiveStoreWithInitialValueAndSlotTracking, createTransactionMessage, extendClient, generateKeyPairSigner, getAbortablePromise, getTransactionEncoder, isAbortError, isAddress, lamports, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, summarizeTransactionPlanResult } from '@solana/kit';
14
+ export * from '@solana/kit';
15
+ export { isAbortError } from '@solana/kit';
15
16
  export { AdaptSolanaIosWalletOptions, GetSolanaIosWalletsOptions, IosWalletCallbackResult, IosWalletInfo, IosWalletMethod, SolanaIosWalletAppIdentity, adaptSolanaIosWallet, getDefaultIosWalletAppIdentity, getDefaultIosWalletRedirectUrl, getSolanaIosWallets, handleSolanaIosWalletCallback, isIosBrowser, isSolanaIosBrowserWalletSupported, isSolanaIosWalletInfo } from './ios-wallet.mjs';
16
17
  export { AdaptSolanaWalletOptions, SOLANA_CHAINS, SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, adaptSolanaStandardWallet, getRegisteredSolanaWallets, getSolanaChain, isSolanaStandardWallet, subscribeSolanaWallets } from './wallet-standard.mjs';
17
18
  export { Buffer } from 'buffer/';
19
+ export { isSolanaMobileWalletSupported } from './mobile-wallet-support.mjs';
18
20
  import '@solana/kit-plugin-rpc';
19
21
  import '@wallet-standard/base';
package/dist/index.d.ts CHANGED
@@ -5,15 +5,17 @@ export { AddressInput, MaybeAddressInput, parseAddress } from './address.js';
5
5
  export { installSolanaBufferPolyfill } from './buffer-polyfill.js';
6
6
  export { SolanaError, SolanaErrorCode, SolanaErrorOptions, createSolanaError, isSolanaError, normalizeSolanaError } from './errors.js';
7
7
  export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, b as SolanaClient, c as SolanaCluster, d as SolanaConfig, e as SolanaContext, f as SolanaSignInAccount, g as SolanaSignInInput, h as SolanaSignInResult, i as SolanaSignMessageResult, j as SolanaTransaction, k as SolanaWallet, l as SolanaWalletInfo, T as TransactionConfirmation, m as TransactionStatus, n as createSolanaClient } from './shared/core.C9vxHRXl.js';
8
- export { RegisterSolanaMobileWalletOptions, SolanaMobileWalletAppIdentity, getDefaultMobileWalletAppIdentity, isSolanaMobileWalletSupported, registerSolanaMobileWallet } from './mobile-wallet.js';
8
+ export { RegisterSolanaMobileWalletOptions, SolanaMobileWalletAppIdentity, getDefaultMobileWalletAppIdentity, registerSolanaMobileWallet } from './mobile-wallet.js';
9
9
  export { createSolanaContext } from './rpc.js';
10
10
  export { TokenAccountInfo, TokenAccountsByOwnerOptions, TokenBalanceResult, getTokenAccount, getTokenAccountsByOwner, getTokenBalance } from './token-accounts.js';
11
11
  export { confirmTransactionSignature, signAndSendTransaction } from './transaction.js';
12
12
  export { withSolanaTimeout, withTimeout } from './timeout.js';
13
13
  export { SolanaWalletError, SolanaWalletErrorCode, assertWalletCanSign, assertWalletCanSignAndSendTransactions, assertWalletCanSignIn, assertWalletCanSignMessage, assertWalletCanSignTransactions, assertWalletConnected, createNoWalletSelectedError, isWalletConnected } from './wallet.js';
14
- export { AccountRole, Address, ClientWithIdentity, ClientWithPayer, ClientWithSubscribeToIdentity, ClientWithSubscribeToPayer, ClientWithTransactionPlanning, ClientWithTransactionSending, Commitment, CreateReactiveStoreWithInitialValueAndSlotTrackingConfig, Instruction, InstructionPlanInput, Lamports, ReactiveActionSource, ReactiveActionState, ReactiveActionStatus, ReactiveActionStore, ReactiveState, ReactiveStreamSource, ReactiveStreamStore, Rpc, Signature, SingleTransactionPlan, SolanaRpcApi, SolanaRpcResponse, SuccessfulSingleTransactionPlanResult, TransactionMessage, TransactionPlan, TransactionPlanInput, TransactionPlanResult, TransactionSigner, address, appendTransactionMessageInstruction, compileTransaction, createReactiveActionStore, createReactiveStoreWithInitialValueAndSlotTracking, createTransactionMessage, extendClient, generateKeyPairSigner, getAbortablePromise, getTransactionEncoder, isAbortError, isAddress, lamports, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, summarizeTransactionPlanResult } from '@solana/kit';
14
+ export * from '@solana/kit';
15
+ export { isAbortError } from '@solana/kit';
15
16
  export { AdaptSolanaIosWalletOptions, GetSolanaIosWalletsOptions, IosWalletCallbackResult, IosWalletInfo, IosWalletMethod, SolanaIosWalletAppIdentity, adaptSolanaIosWallet, getDefaultIosWalletAppIdentity, getDefaultIosWalletRedirectUrl, getSolanaIosWallets, handleSolanaIosWalletCallback, isIosBrowser, isSolanaIosBrowserWalletSupported, isSolanaIosWalletInfo } from './ios-wallet.js';
16
17
  export { AdaptSolanaWalletOptions, SOLANA_CHAINS, SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, adaptSolanaStandardWallet, getRegisteredSolanaWallets, getSolanaChain, isSolanaStandardWallet, subscribeSolanaWallets } from './wallet-standard.js';
17
18
  export { Buffer } from 'buffer/';
19
+ export { isSolanaMobileWalletSupported } from './mobile-wallet-support.js';
18
20
  import '@solana/kit-plugin-rpc';
19
21
  import '@wallet-standard/base';
package/dist/index.mjs CHANGED
@@ -4,20 +4,15 @@ export { parseAddress } from './address.mjs';
4
4
  export { installSolanaBufferPolyfill } from './buffer-polyfill.mjs';
5
5
  export { SolanaError, createSolanaError, isSolanaError, normalizeSolanaError } from './errors.mjs';
6
6
  export { createSolanaClient } from './kit.mjs';
7
- export { getDefaultMobileWalletAppIdentity, isSolanaMobileWalletSupported, registerSolanaMobileWallet } from './mobile-wallet.mjs';
7
+ export { getDefaultMobileWalletAppIdentity, registerSolanaMobileWallet } from './mobile-wallet.mjs';
8
8
  export { createSolanaContext } from './rpc.mjs';
9
9
  export { getTokenAccount, getTokenAccountsByOwner, getTokenBalance } from './token-accounts.mjs';
10
10
  export { confirmTransactionSignature, signAndSendTransaction } from './transaction.mjs';
11
11
  export { withSolanaTimeout, withTimeout } from './timeout.mjs';
12
12
  export { SolanaWalletError, assertWalletCanSign, assertWalletCanSignAndSendTransactions, assertWalletCanSignIn, assertWalletCanSignMessage, assertWalletCanSignTransactions, assertWalletConnected, createNoWalletSelectedError, isWalletConnected } from './wallet.mjs';
13
- export { AccountRole, address, appendTransactionMessageInstruction, compileTransaction, createReactiveActionStore, createReactiveStoreWithInitialValueAndSlotTracking, createTransactionMessage, extendClient, generateKeyPairSigner, getAbortablePromise, getTransactionEncoder, isAbortError, isAddress, lamports, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, summarizeTransactionPlanResult } from '@solana/kit';
13
+ export * from '@solana/kit';
14
+ export { isAbortError } from '@solana/kit';
14
15
  export { Buffer } from 'buffer/';
15
- export { S as SOLANA_CHAINS, a as SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, b as adaptSolanaStandardWallet, g as getRegisteredSolanaWallets, c as getSolanaChain, i as isSolanaStandardWallet, s as subscribeSolanaWallets } from './shared/core.TqudP0hB.mjs';
16
- export { a as adaptSolanaIosWallet, g as getDefaultIosWalletAppIdentity, b as getDefaultIosWalletRedirectUrl, c as getSolanaIosWallets, h as handleSolanaIosWalletCallback, i as isIosBrowser, d as isSolanaIosBrowserWalletSupported, e as isSolanaIosWalletInfo } from './shared/core.CDVW-ApZ.mjs';
17
- import '@solana/kit-plugin-rpc';
18
- import '@solana-mobile/wallet-standard-mobile';
19
- import '@wallet-standard/features';
20
- import '@solana/wallet-standard-features';
21
- import 'bs58';
22
- import '@wallet-standard/app';
23
- import 'tweetnacl';
16
+ export { S as SOLANA_CHAINS, a as SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, b as adaptSolanaStandardWallet, g as getRegisteredSolanaWallets, c as getSolanaChain, i as isSolanaStandardWallet, s as subscribeSolanaWallets } from './shared/core.DaUlAmcN.mjs';
17
+ export { a as adaptSolanaIosWallet, g as getDefaultIosWalletAppIdentity, b as getDefaultIosWalletRedirectUrl, c as getSolanaIosWallets, h as handleSolanaIosWalletCallback, i as isIosBrowser, d as isSolanaIosBrowserWalletSupported, e as isSolanaIosWalletInfo } from './shared/core.DJsPYgx_.mjs';
18
+ export { isSolanaMobileWalletSupported } from './mobile-wallet-support.mjs';
@@ -1,4 +1 @@
1
- export { a as adaptSolanaIosWallet, g as getDefaultIosWalletAppIdentity, b as getDefaultIosWalletRedirectUrl, c as getSolanaIosWallets, h as handleSolanaIosWalletCallback, i as isIosBrowser, d as isSolanaIosBrowserWalletSupported, e as isSolanaIosWalletInfo } from './shared/core.CDVW-ApZ.mjs';
2
- import '@solana/kit';
3
- import 'bs58';
4
- import 'tweetnacl';
1
+ export { a as adaptSolanaIosWallet, g as getDefaultIosWalletAppIdentity, b as getDefaultIosWalletRedirectUrl, c as getSolanaIosWallets, h as handleSolanaIosWalletCallback, i as isIosBrowser, d as isSolanaIosBrowserWalletSupported, e as isSolanaIosWalletInfo } from './shared/core.DJsPYgx_.mjs';
package/dist/kit.d.mts CHANGED
@@ -1,3 +1,3 @@
1
1
  import '@solana/kit-plugin-rpc';
2
- export { AccountRole, Address, ClientWithIdentity, ClientWithPayer, ClientWithSubscribeToIdentity, ClientWithSubscribeToPayer, ClientWithTransactionPlanning, ClientWithTransactionSending, Commitment, CreateReactiveStoreWithInitialValueAndSlotTrackingConfig, Instruction, InstructionPlanInput, Lamports, ReactiveActionSource, ReactiveActionState, ReactiveActionStatus, ReactiveActionStore, ReactiveState, ReactiveStreamSource, ReactiveStreamStore, Rpc, Signature, SingleTransactionPlan, SolanaRpcApi, SolanaRpcResponse, SuccessfulSingleTransactionPlanResult, TransactionMessage, TransactionPlan, TransactionPlanInput, TransactionPlanResult, TransactionSigner, address, appendTransactionMessageInstruction, compileTransaction, createReactiveActionStore, createReactiveStoreWithInitialValueAndSlotTracking, createTransactionMessage, extendClient, generateKeyPairSigner, getAbortablePromise, getTransactionEncoder, isAbortError, isAddress, lamports, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, summarizeTransactionPlanResult } from '@solana/kit';
2
+ export * from '@solana/kit';
3
3
  export { b as SolanaClient, n as createSolanaClient } from './shared/core.C9vxHRXl.mjs';
package/dist/kit.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import '@solana/kit-plugin-rpc';
2
- export { AccountRole, Address, ClientWithIdentity, ClientWithPayer, ClientWithSubscribeToIdentity, ClientWithSubscribeToPayer, ClientWithTransactionPlanning, ClientWithTransactionSending, Commitment, CreateReactiveStoreWithInitialValueAndSlotTrackingConfig, Instruction, InstructionPlanInput, Lamports, ReactiveActionSource, ReactiveActionState, ReactiveActionStatus, ReactiveActionStore, ReactiveState, ReactiveStreamSource, ReactiveStreamStore, Rpc, Signature, SingleTransactionPlan, SolanaRpcApi, SolanaRpcResponse, SuccessfulSingleTransactionPlanResult, TransactionMessage, TransactionPlan, TransactionPlanInput, TransactionPlanResult, TransactionSigner, address, appendTransactionMessageInstruction, compileTransaction, createReactiveActionStore, createReactiveStoreWithInitialValueAndSlotTracking, createTransactionMessage, extendClient, generateKeyPairSigner, getAbortablePromise, getTransactionEncoder, isAbortError, isAddress, lamports, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, summarizeTransactionPlanResult } from '@solana/kit';
2
+ export * from '@solana/kit';
3
3
  export { b as SolanaClient, n as createSolanaClient } from './shared/core.C9vxHRXl.js';
package/dist/kit.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { getBase64Encoder, getBase58Decoder, signBytes, createClient, extendClient, createKeyPairFromBytes, isSolanaError, SOLANA_ERROR__KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY } from '@solana/kit';
2
- export { AccountRole, address, appendTransactionMessageInstruction, compileTransaction, createReactiveActionStore, createReactiveStoreWithInitialValueAndSlotTracking, createTransactionMessage, extendClient, generateKeyPairSigner, getAbortablePromise, getTransactionEncoder, isAbortError, isAddress, lamports, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, summarizeTransactionPlanResult } from '@solana/kit';
2
+ export * from '@solana/kit';
3
3
  import { solanaRpc, rpcAirdrop } from '@solana/kit-plugin-rpc';
4
4
  import { DEFAULT_CLUSTER, getClusterEndpoint, getWebSocketEndpoint, getClusterWebSocketEndpoint } from './clusters.mjs';
5
5
 
@@ -37,7 +37,7 @@ function resolvePayerFromSecretKey(payerSecretKey) {
37
37
  if (keyPairBytes.length !== 64) {
38
38
  throw invalidError();
39
39
  }
40
- const address2 = getBase58Decoder().decode(keyPairBytes.slice(32));
40
+ const address = getBase58Decoder().decode(keyPairBytes.slice(32));
41
41
  let privateKey;
42
42
  const getPrivateKey = () => privateKey ??= (async () => {
43
43
  if (!globalThis.crypto?.subtle) {
@@ -53,14 +53,14 @@ function resolvePayerFromSecretKey(payerSecretKey) {
53
53
  throw cause;
54
54
  });
55
55
  return {
56
- address: address2,
56
+ address,
57
57
  async signTransactions(transactions, config) {
58
58
  config?.abortSignal?.throwIfAborted();
59
59
  const key = await getPrivateKey();
60
60
  config?.abortSignal?.throwIfAborted();
61
61
  return Promise.all(
62
62
  transactions.map(async (transaction) => ({
63
- [address2]: await signBytes(key, transaction.messageBytes)
63
+ [address]: await signBytes(key, transaction.messageBytes)
64
64
  }))
65
65
  );
66
66
  }
@@ -0,0 +1,3 @@
1
+ declare function isSolanaMobileWalletSupported(): boolean;
2
+
3
+ export { isSolanaMobileWalletSupported };
@@ -0,0 +1,3 @@
1
+ declare function isSolanaMobileWalletSupported(): boolean;
2
+
3
+ export { isSolanaMobileWalletSupported };
@@ -0,0 +1,5 @@
1
+ function isSolanaMobileWalletSupported() {
2
+ return typeof window !== "undefined" && window.isSecureContext && /android/i.test(navigator.userAgent);
3
+ }
4
+
5
+ export { isSolanaMobileWalletSupported };
@@ -1,3 +1,4 @@
1
+ export { isSolanaMobileWalletSupported } from './mobile-wallet-support.mjs';
1
2
  import { a as SolanaChain } from './shared/core.C9vxHRXl.mjs';
2
3
  import '@solana/kit-plugin-rpc';
3
4
  import '@solana/kit';
@@ -13,8 +14,7 @@ interface RegisterSolanaMobileWalletOptions {
13
14
  remoteHostAuthority?: string;
14
15
  }
15
16
  declare function registerSolanaMobileWallet(options?: RegisterSolanaMobileWalletOptions): boolean;
16
- declare function isSolanaMobileWalletSupported(): boolean;
17
17
  declare function getDefaultMobileWalletAppIdentity(): SolanaMobileWalletAppIdentity;
18
18
 
19
- export { getDefaultMobileWalletAppIdentity, isSolanaMobileWalletSupported, registerSolanaMobileWallet };
19
+ export { getDefaultMobileWalletAppIdentity, registerSolanaMobileWallet };
20
20
  export type { RegisterSolanaMobileWalletOptions, SolanaMobileWalletAppIdentity };
@@ -1,3 +1,4 @@
1
+ export { isSolanaMobileWalletSupported } from './mobile-wallet-support.js';
1
2
  import { a as SolanaChain } from './shared/core.C9vxHRXl.js';
2
3
  import '@solana/kit-plugin-rpc';
3
4
  import '@solana/kit';
@@ -13,8 +14,7 @@ interface RegisterSolanaMobileWalletOptions {
13
14
  remoteHostAuthority?: string;
14
15
  }
15
16
  declare function registerSolanaMobileWallet(options?: RegisterSolanaMobileWalletOptions): boolean;
16
- declare function isSolanaMobileWalletSupported(): boolean;
17
17
  declare function getDefaultMobileWalletAppIdentity(): SolanaMobileWalletAppIdentity;
18
18
 
19
- export { getDefaultMobileWalletAppIdentity, isSolanaMobileWalletSupported, registerSolanaMobileWallet };
19
+ export { getDefaultMobileWalletAppIdentity, registerSolanaMobileWallet };
20
20
  export type { RegisterSolanaMobileWalletOptions, SolanaMobileWalletAppIdentity };
@@ -1,4 +1,5 @@
1
1
  import { registerMwa, createDefaultWalletNotFoundHandler, createDefaultChainSelector, createDefaultAuthorizationCache } from '@solana-mobile/wallet-standard-mobile';
2
+ import { isSolanaMobileWalletSupported } from './mobile-wallet-support.mjs';
2
3
 
3
4
  const DEFAULT_MOBILE_WALLET_CHAINS = ["solana:mainnet", "solana:devnet"];
4
5
  const registeredMobileWalletKeys = /* @__PURE__ */ new Set();
@@ -27,15 +28,6 @@ function registerSolanaMobileWallet(options = {}) {
27
28
  registeredMobileWalletKeys.add(registrationKey);
28
29
  return true;
29
30
  }
30
- function isSolanaMobileWalletSupported() {
31
- if (typeof window === "undefined" || typeof navigator === "undefined") {
32
- return false;
33
- }
34
- const userAgent = navigator.userAgent;
35
- const isAndroid = /Android/i.test(userAgent);
36
- const isChrome = /Chrome|CriOS/i.test(userAgent) && !/Edg|OPR|Firefox|FxiOS/i.test(userAgent);
37
- return isAndroid && isChrome;
38
- }
39
31
  function getDefaultMobileWalletAppIdentity() {
40
32
  if (typeof window === "undefined") {
41
33
  return {
package/dist/rpc.mjs CHANGED
@@ -1,7 +1,5 @@
1
1
  import { DEFAULT_CLUSTER, getClusterEndpoint, getWebSocketEndpoint, getClusterWebSocketEndpoint } from './clusters.mjs';
2
2
  import { createSolanaClient } from './kit.mjs';
3
- import '@solana/kit';
4
- import '@solana/kit-plugin-rpc';
5
3
 
6
4
  function createSolanaContext(config = {}) {
7
5
  const cluster = config.cluster ?? DEFAULT_CLUSTER;
@@ -1,6 +1,7 @@
1
1
  import { isAddress } from '@solana/kit';
2
2
  import bs58 from 'bs58';
3
3
  import * as naclModule from 'tweetnacl';
4
+ import { createSolanaError } from '../errors.mjs';
4
5
 
5
6
  const DEFAULT_IOS_WALLET_CHAINS = [
6
7
  "solana:mainnet",
@@ -106,25 +107,74 @@ function isObjectRecord(value) {
106
107
  return typeof value === "object" && value !== null;
107
108
  }
108
109
 
109
- const nacl = resolveTweetNaCl();
110
+ let cachedNacl;
111
+ function getNacl() {
112
+ return cachedNacl ??= resolveTweetNaCl();
113
+ }
110
114
  function createRequestId() {
111
- return bs58.encode(nacl.randomBytes(16));
115
+ return bs58.encode(getNacl().randomBytes(16));
112
116
  }
113
117
  function getSharedSecret(walletEncryptionPublicKey, dappSecretKey) {
114
118
  if (!walletEncryptionPublicKey) {
115
- throw new Error("Missing iOS wallet encryption public key");
119
+ throw createSolanaError("INVALID_INPUT", "Missing iOS wallet encryption public key");
120
+ }
121
+ let walletPk;
122
+ let dappSk;
123
+ try {
124
+ walletPk = bs58.decode(walletEncryptionPublicKey);
125
+ dappSk = bs58.decode(dappSecretKey);
126
+ } catch (cause) {
127
+ throw createSolanaError("INVALID_INPUT", "Invalid iOS wallet encryption key encoding", {
128
+ cause
129
+ });
130
+ }
131
+ if (walletPk.length !== getNacl().box.publicKeyLength) {
132
+ throw createSolanaError("INVALID_INPUT", "Invalid iOS wallet encryption public key length");
133
+ }
134
+ if (dappSk.length !== getNacl().box.secretKeyLength) {
135
+ throw createSolanaError("INVALID_INPUT", "Invalid iOS wallet dapp secret key length");
116
136
  }
117
- return nacl.box.before(bs58.decode(walletEncryptionPublicKey), bs58.decode(dappSecretKey));
137
+ return getNacl().box.before(walletPk, dappSk);
118
138
  }
119
139
  function encryptPayload(payload, nonce, sharedSecret) {
120
- return bs58.encode(nacl.box.after(encodeJson(payload), nonce, sharedSecret));
140
+ if (sharedSecret.length !== getNacl().box.sharedKeyLength) {
141
+ throw createSolanaError("INVALID_INPUT", "Invalid iOS wallet shared secret length");
142
+ }
143
+ if (nonce.length !== getNacl().box.nonceLength) {
144
+ throw createSolanaError("INVALID_INPUT", "Invalid iOS wallet nonce length");
145
+ }
146
+ try {
147
+ return bs58.encode(getNacl().box.after(encodeJson(payload), nonce, sharedSecret));
148
+ } catch (cause) {
149
+ throw createSolanaError("INVALID_INPUT", "Failed to encrypt iOS wallet payload", { cause });
150
+ }
121
151
  }
122
152
  function decryptPayload(data, nonce, sharedSecret) {
123
- const decrypted = nacl.box.open.after(bs58.decode(data), bs58.decode(nonce), sharedSecret);
153
+ let decodedData;
154
+ let decodedNonce;
155
+ try {
156
+ decodedData = bs58.decode(data);
157
+ decodedNonce = bs58.decode(nonce);
158
+ } catch (cause) {
159
+ throw createSolanaError("INVALID_INPUT", "Invalid iOS wallet callback encoding", { cause });
160
+ }
161
+ if (sharedSecret.length !== getNacl().box.sharedKeyLength) {
162
+ throw createSolanaError("INVALID_INPUT", "Invalid iOS wallet shared secret length");
163
+ }
164
+ if (decodedNonce.length !== getNacl().box.nonceLength) {
165
+ throw createSolanaError("INVALID_INPUT", "Invalid iOS wallet callback nonce length");
166
+ }
167
+ const decrypted = getNacl().box.open.after(decodedData, decodedNonce, sharedSecret);
124
168
  if (!decrypted) {
125
- throw new Error("Unable to decrypt iOS wallet callback");
169
+ throw createSolanaError("DECRYPTION_FAILED", "Unable to decrypt iOS wallet callback");
170
+ }
171
+ try {
172
+ return JSON.parse(new TextDecoder().decode(decrypted));
173
+ } catch (cause) {
174
+ throw createSolanaError("DECRYPTION_FAILED", "Unable to decode iOS wallet callback payload", {
175
+ cause
176
+ });
126
177
  }
127
- return JSON.parse(new TextDecoder().decode(decrypted));
128
178
  }
129
179
  function resolveTweetNaCl() {
130
180
  const moduleDefault = naclModule.default;
@@ -212,47 +262,50 @@ function getStoredIosWalletAccount(walletId, chains) {
212
262
  ];
213
263
  }
214
264
  function getStoredSession(walletId) {
215
- const value = getStorage()?.getItem(`${SESSION_PREFIX}${walletId}`);
216
- if (!value) {
217
- return null;
218
- }
219
- try {
220
- const session = JSON.parse(value);
221
- if (!isAddress(session.publicKey)) {
222
- throw new Error("Invalid stored public key");
223
- }
224
- return session;
225
- } catch {
226
- removeStoredSession(walletId);
227
- return null;
228
- }
265
+ return readJson(
266
+ `${SESSION_PREFIX}${walletId}`,
267
+ (session) => isAddress(session.publicKey)
268
+ );
229
269
  }
230
270
  function storeSession(session) {
231
- getStorage()?.setItem(`${SESSION_PREFIX}${session.walletId}`, JSON.stringify(session));
271
+ writeJson(`${SESSION_PREFIX}${session.walletId}`, session);
232
272
  }
233
273
  function removeStoredSession(walletId) {
234
- getStorage()?.removeItem(`${SESSION_PREFIX}${walletId}`);
274
+ removeJson(`${SESSION_PREFIX}${walletId}`);
235
275
  }
236
276
  function getPendingRequest() {
237
- const value = getStorage()?.getItem(PENDING_REQUEST_KEY);
277
+ return readJson(PENDING_REQUEST_KEY);
278
+ }
279
+ function storePendingRequest(request) {
280
+ writeJson(PENDING_REQUEST_KEY, request);
281
+ }
282
+ function clearPendingRequest() {
283
+ removeJson(PENDING_REQUEST_KEY);
284
+ }
285
+ function isPendingRequestExpired(request) {
286
+ return Date.now() - request.createdAt > PENDING_REQUEST_TTL_MS;
287
+ }
288
+ function readJson(key, validate) {
289
+ const value = getStorage()?.getItem(key);
238
290
  if (!value) {
239
291
  return null;
240
292
  }
241
293
  try {
242
- return JSON.parse(value);
294
+ const parsed = JSON.parse(value);
295
+ if (validate && !validate(parsed)) {
296
+ throw new Error("Invalid stored value");
297
+ }
298
+ return parsed;
243
299
  } catch {
244
- clearPendingRequest();
300
+ getStorage()?.removeItem(key);
245
301
  return null;
246
302
  }
247
303
  }
248
- function storePendingRequest(request) {
249
- getStorage()?.setItem(PENDING_REQUEST_KEY, JSON.stringify(request));
304
+ function writeJson(key, value) {
305
+ getStorage()?.setItem(key, JSON.stringify(value));
250
306
  }
251
- function clearPendingRequest() {
252
- getStorage()?.removeItem(PENDING_REQUEST_KEY);
253
- }
254
- function isPendingRequestExpired(request) {
255
- return Date.now() - request.createdAt > PENDING_REQUEST_TTL_MS;
307
+ function removeJson(key) {
308
+ getStorage()?.removeItem(key);
256
309
  }
257
310
  function getStorage() {
258
311
  if (typeof window === "undefined") {
@@ -380,7 +433,7 @@ function getPublicKeyField(payload, field) {
380
433
  }
381
434
 
382
435
  function launchConnect(definition, options) {
383
- const keyPair = nacl.box.keyPair();
436
+ const keyPair = getNacl().box.keyPair();
384
437
  const pending = createPendingRequest(definition.id, "connect", keyPair, options.redirectUrl);
385
438
  const appIdentity = options.appIdentity ?? getDefaultIosWalletAppIdentity();
386
439
  const url = new URL(definition.connectUrl);
@@ -442,7 +495,7 @@ async function launchEncryptedWalletRequest(definition, method, options, payload
442
495
  options.redirectUrl,
443
496
  method === "signAllTransactions" && Array.isArray(payload.transactions) ? payload.transactions.length : void 0
444
497
  );
445
- const nonce = nacl.randomBytes(nacl.box.nonceLength);
498
+ const nonce = getNacl().randomBytes(getNacl().box.nonceLength);
446
499
  const encryptedPayload = encryptPayload(
447
500
  { ...payload, session: session.session },
448
501
  nonce,
@@ -104,7 +104,9 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
104
104
  }
105
105
  },
106
106
  signIn: hasSignIn(wallet) ? async (input) => {
107
- const [result] = await wallet.features[SolanaSignIn].signIn(...input ? [input] : []);
107
+ const [result] = await wallet.features[SolanaSignIn].signIn(
108
+ input ?? getDefaultSignInInput(getActiveAccount(account))
109
+ );
108
110
  if (!result) {
109
111
  throw new Error("Solana wallet did not return a sign-in result");
110
112
  }
@@ -133,27 +135,12 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
133
135
  }
134
136
  return result.signedTransaction;
135
137
  } : void 0,
136
- signAllTransactions: hasSignTransaction(wallet) ? async (transactions) => {
137
- const activeAccount = getActiveAccount(account);
138
- const results = await wallet.features[SolanaSignTransaction].signTransaction(
139
- ...transactions.map((transaction) => ({
140
- account: activeAccount,
141
- transaction: new Uint8Array(transaction),
142
- chain: options.chain
143
- }))
144
- );
145
- if (results.length !== transactions.length) {
146
- throw new Error(
147
- `Solana wallet returned ${results.length} signed transactions for ${transactions.length} requested transactions`
148
- );
149
- }
150
- return results.map((result) => {
151
- if (!result) {
152
- throw new Error("Solana wallet did not return a signed transaction");
153
- }
154
- return result.signedTransaction;
155
- });
156
- } : void 0,
138
+ signAllTransactions: hasSignTransaction(wallet) ? async (transactions) => signAllThroughFeature(
139
+ wallet,
140
+ () => getActiveAccount(account),
141
+ transactions,
142
+ options.chain
143
+ ) : void 0,
157
144
  signTransactions: hasSignTransaction(wallet) ? async (transactions) => signAllThroughFeature(
158
145
  wallet,
159
146
  () => getActiveAccount(account),
@@ -218,6 +205,12 @@ async function signAllThroughFeature(wallet, getAccount, transactions, chain) {
218
205
  return result.signedTransaction;
219
206
  });
220
207
  }
208
+ function getDefaultSignInInput(account) {
209
+ return {
210
+ domain: typeof location === "undefined" ? "" : location.host,
211
+ address: account.address
212
+ };
213
+ }
221
214
  function toSolanaSignInResult(result) {
222
215
  return {
223
216
  account: {
package/dist/timeout.mjs CHANGED
@@ -7,6 +7,9 @@ function withTimeout(promise, timeoutMs, createError) {
7
7
  let timeoutId;
8
8
  return Promise.race([
9
9
  promise,
10
+ // ponytail: the try/catch looks redundant but is not. `createError()` runs
11
+ // in the `setTimeout` callback, not the executor body, so a throwing
12
+ // factory would be an uncaught exception rather than a rejection.
10
13
  new Promise((_, reject) => {
11
14
  timeoutId = setTimeout(() => {
12
15
  try {
@@ -1,5 +1 @@
1
- export { S as SOLANA_CHAINS, a as SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, b as adaptSolanaStandardWallet, g as getRegisteredSolanaWallets, c as getSolanaChain, i as isSolanaStandardWallet, s as subscribeSolanaWallets } from './shared/core.TqudP0hB.mjs';
2
- import '@wallet-standard/features';
3
- import '@solana/wallet-standard-features';
4
- import 'bs58';
5
- import '@wallet-standard/app';
1
+ export { S as SOLANA_CHAINS, a as SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, b as adaptSolanaStandardWallet, g as getRegisteredSolanaWallets, c as getSolanaChain, i as isSolanaStandardWallet, s as subscribeSolanaWallets } from './shared/core.DaUlAmcN.mjs';
package/dist/wallet.mjs CHANGED
@@ -17,55 +17,42 @@ function assertWalletConnected(wallet) {
17
17
  throw new SolanaWalletError("WALLET_NOT_CONNECTED", "Solana wallet is not connected");
18
18
  }
19
19
  }
20
- function assertWalletCanSign(wallet) {
20
+ function assertWalletFeature(wallet, features, message) {
21
21
  assertWalletConnected(wallet);
22
- if (!wallet.signTransaction) {
23
- throw new SolanaWalletError(
24
- "WALLET_FEATURE_UNSUPPORTED",
25
- "Solana wallet does not support signTransaction",
26
- { feature: "signTransaction" }
27
- );
22
+ if (!features.some((feature) => wallet[feature])) {
23
+ throw new SolanaWalletError("WALLET_FEATURE_UNSUPPORTED", message, { feature: features[0] });
28
24
  }
29
25
  }
26
+ function assertWalletCanSign(wallet) {
27
+ assertWalletFeature(
28
+ wallet,
29
+ ["signTransaction"],
30
+ "Solana wallet does not support signTransaction"
31
+ );
32
+ }
30
33
  function assertWalletCanSignMessage(wallet) {
31
- assertWalletConnected(wallet);
32
- if (!wallet.signMessage) {
33
- throw new SolanaWalletError(
34
- "WALLET_FEATURE_UNSUPPORTED",
35
- "Solana wallet does not support signMessage",
36
- { feature: "signMessage" }
37
- );
38
- }
34
+ assertWalletFeature(wallet, ["signMessage"], "Solana wallet does not support signMessage");
39
35
  }
40
36
  function assertWalletCanSignIn(wallet) {
41
- assertWalletConnected(wallet);
42
- if (!wallet.signIn) {
43
- throw new SolanaWalletError(
44
- "WALLET_FEATURE_UNSUPPORTED",
45
- "Solana wallet does not support signIn (Sign In With Solana)",
46
- { feature: "signIn" }
47
- );
48
- }
37
+ assertWalletFeature(
38
+ wallet,
39
+ ["signIn"],
40
+ "Solana wallet does not support signIn (Sign In With Solana)"
41
+ );
49
42
  }
50
43
  function assertWalletCanSignTransactions(wallet) {
51
- assertWalletConnected(wallet);
52
- if (!wallet.signTransactions && !wallet.signAllTransactions) {
53
- throw new SolanaWalletError(
54
- "WALLET_FEATURE_UNSUPPORTED",
55
- "Solana wallet does not support signTransactions",
56
- { feature: "signTransactions" }
57
- );
58
- }
44
+ assertWalletFeature(
45
+ wallet,
46
+ ["signTransactions", "signAllTransactions"],
47
+ "Solana wallet does not support signTransactions"
48
+ );
59
49
  }
60
50
  function assertWalletCanSignAndSendTransactions(wallet) {
61
- assertWalletConnected(wallet);
62
- if (!wallet.signAndSendTransactions && !wallet.signAndSendTransaction) {
63
- throw new SolanaWalletError(
64
- "WALLET_FEATURE_UNSUPPORTED",
65
- "Solana wallet does not support signAndSendTransactions",
66
- { feature: "signAndSendTransactions" }
67
- );
68
- }
51
+ assertWalletFeature(
52
+ wallet,
53
+ ["signAndSendTransactions", "signAndSendTransaction"],
54
+ "Solana wallet does not support signAndSendTransactions"
55
+ );
69
56
  }
70
57
 
71
58
  export { SolanaWalletError, assertWalletCanSign, assertWalletCanSignAndSendTransactions, assertWalletCanSignIn, assertWalletCanSignMessage, assertWalletCanSignTransactions, assertWalletConnected, createNoWalletSelectedError, isWalletConnected };