@vue-solana/core 1.2.0 → 2.0.0

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 (73) hide show
  1. package/README.md +44 -35
  2. package/dist/address.cjs +10 -10
  3. package/dist/address.d.cts +11 -13
  4. package/dist/address.d.mts +11 -13
  5. package/dist/address.d.ts +11 -13
  6. package/dist/address.mjs +10 -10
  7. package/dist/buffer-polyfill.d.cts +0 -1
  8. package/dist/buffer-polyfill.d.mts +0 -1
  9. package/dist/buffer-polyfill.d.ts +0 -1
  10. package/dist/clusters.d.cts +1 -4
  11. package/dist/clusters.d.mts +1 -4
  12. package/dist/clusters.d.ts +1 -4
  13. package/dist/index.cjs +3 -19
  14. package/dist/index.d.cts +5 -9
  15. package/dist/index.d.mts +5 -9
  16. package/dist/index.d.ts +5 -9
  17. package/dist/index.mjs +4 -6
  18. package/dist/ios-wallet.cjs +2 -2
  19. package/dist/ios-wallet.d.cts +1 -4
  20. package/dist/ios-wallet.d.mts +1 -4
  21. package/dist/ios-wallet.d.ts +1 -4
  22. package/dist/ios-wallet.mjs +2 -2
  23. package/dist/kit.d.cts +2 -5
  24. package/dist/kit.d.mts +2 -5
  25. package/dist/kit.d.ts +2 -5
  26. package/dist/mobile-wallet.d.cts +1 -4
  27. package/dist/mobile-wallet.d.mts +1 -4
  28. package/dist/mobile-wallet.d.ts +1 -4
  29. package/dist/rpc.cjs +0 -12
  30. package/dist/rpc.d.cts +2 -11
  31. package/dist/rpc.d.mts +2 -11
  32. package/dist/rpc.d.ts +2 -11
  33. package/dist/rpc.mjs +1 -12
  34. package/dist/shared/{core.DjbtrJWl.mjs → core.BOHiMZiM.mjs} +7 -33
  35. package/dist/shared/{core.Ch_Z7_17.mjs → core.BwW4HVQI.mjs} +12 -28
  36. package/dist/shared/{core.BsekSwcZ.cjs → core.Cb48vQvC.cjs} +12 -28
  37. package/dist/shared/{core.BQoh-5Wu.cjs → core.Cu_gaUSn.cjs} +20 -46
  38. package/dist/shared/{core.DAUuCWrr.d.mts → core.DMgTrB_2.d.cts} +21 -17
  39. package/dist/shared/{core.DAUuCWrr.d.ts → core.DMgTrB_2.d.mts} +21 -17
  40. package/dist/shared/{core.DAUuCWrr.d.cts → core.DMgTrB_2.d.ts} +21 -17
  41. package/dist/token-accounts.cjs +44 -28
  42. package/dist/token-accounts.d.cts +20 -20
  43. package/dist/token-accounts.d.mts +20 -20
  44. package/dist/token-accounts.d.ts +20 -20
  45. package/dist/token-accounts.mjs +44 -28
  46. package/dist/transaction.cjs +50 -31
  47. package/dist/transaction.d.cts +9 -15
  48. package/dist/transaction.d.mts +9 -15
  49. package/dist/transaction.d.ts +9 -15
  50. package/dist/transaction.mjs +51 -32
  51. package/dist/types.d.cts +1 -4
  52. package/dist/types.d.mts +1 -4
  53. package/dist/types.d.ts +1 -4
  54. package/dist/wallet-standard.cjs +1 -4
  55. package/dist/wallet-standard.d.cts +1 -4
  56. package/dist/wallet-standard.d.mts +1 -4
  57. package/dist/wallet-standard.d.ts +1 -4
  58. package/dist/wallet-standard.mjs +1 -4
  59. package/dist/wallet.d.cts +1 -4
  60. package/dist/wallet.d.mts +1 -4
  61. package/dist/wallet.d.ts +1 -4
  62. package/package.json +1 -13
  63. package/dist/spl-token.cjs +0 -12
  64. package/dist/spl-token.d.cts +0 -4
  65. package/dist/spl-token.d.mts +0 -4
  66. package/dist/spl-token.d.ts +0 -4
  67. package/dist/spl-token.mjs +0 -1
  68. package/dist/web3.cjs +0 -13
  69. package/dist/web3.d.cts +0 -3
  70. package/dist/web3.d.mts +0 -3
  71. package/dist/web3.d.ts +0 -3
  72. package/dist/web3.mjs +0 -1
  73. package/types/web3-compat.d.ts +0 -140
@@ -1,61 +1,80 @@
1
1
  'use strict';
2
2
 
3
+ const kit = require('@solana/kit');
3
4
  const errors = require('./errors.cjs');
4
- const timeout = require('./timeout.cjs');
5
5
  const wallet = require('./wallet.cjs');
6
6
 
7
7
  const DEFAULT_CONFIRMATION_COMMITMENT = "confirmed";
8
8
  const DEFAULT_CONFIRMATION_TIMEOUT_MS = 6e4;
9
- async function signAndSendTransaction(connection, wallet$1, transaction, options) {
9
+ const SIGNATURE_STATUS_POLL_INTERVAL_MS = 1500;
10
+ const COMMITMENT_RANK = { processed: 0, confirmed: 1, finalized: 2 };
11
+ async function signAndSendTransaction(client, wallet$1, transaction, options) {
10
12
  try {
11
13
  wallet.assertWalletConnected(wallet$1);
12
- if (isMobileWalletAdapterWallet(wallet$1) && wallet$1.signTransaction) {
13
- wallet.assertWalletCanSign(wallet$1);
14
- return await signAndSendRawTransaction(connection, wallet$1, transaction, options);
15
- }
16
14
  if (wallet$1.signAndSendTransaction) {
17
15
  const result = await wallet$1.signAndSendTransaction(transaction, options);
18
16
  return result.signature;
19
17
  }
20
18
  wallet.assertWalletCanSign(wallet$1);
21
- return await signAndSendRawTransaction(connection, wallet$1, transaction, options);
19
+ const signedTransaction = await wallet$1.signTransaction(transaction);
20
+ const base64Transaction = toBase64WireTransaction(signedTransaction);
21
+ const { maxRetries, minContextSlot, preflightCommitment, skipPreflight } = options ?? {};
22
+ return await client.rpc.sendTransaction(base64Transaction, {
23
+ encoding: "base64",
24
+ maxRetries,
25
+ minContextSlot,
26
+ preflightCommitment,
27
+ skipPreflight
28
+ }).send();
22
29
  } catch (cause) {
23
30
  throw errors.normalizeSolanaError(cause, "RPC_FAILURE");
24
31
  }
25
32
  }
26
- async function confirmTransactionSignature(connection, signature, options = {}) {
33
+ async function confirmTransactionSignature(client, signature, options = {}) {
27
34
  const commitment = options.commitment ?? DEFAULT_CONFIRMATION_COMMITMENT;
28
- const confirmation = connection.confirmTransaction(signature, commitment);
29
- let result;
35
+ const timeoutMs = options.timeoutMs ?? DEFAULT_CONFIRMATION_TIMEOUT_MS;
36
+ let elapsedMs = 0;
30
37
  try {
31
- result = await timeout.withSolanaTimeout(
32
- confirmation,
33
- options.timeoutMs ?? DEFAULT_CONFIRMATION_TIMEOUT_MS,
38
+ while (elapsedMs < timeoutMs) {
39
+ const response = await client.rpc.getSignatureStatuses([signature]).send();
40
+ const [status] = response.value;
41
+ if (!status) {
42
+ throw new Error(`Transaction ${signature} was not found.`);
43
+ }
44
+ if (status.err) {
45
+ throw errors.createSolanaError(
46
+ "RPC_FAILURE",
47
+ `Transaction ${signature} failed to reach ${commitment} commitment.`,
48
+ { cause: status.err }
49
+ );
50
+ }
51
+ if (hasReachedCommitment(status.confirmationStatus, commitment)) {
52
+ return { signature, commitment, status };
53
+ }
54
+ await wait(SIGNATURE_STATUS_POLL_INTERVAL_MS);
55
+ elapsedMs += SIGNATURE_STATUS_POLL_INTERVAL_MS;
56
+ }
57
+ throw errors.createSolanaError(
58
+ "TRANSACTION_TIMEOUT",
34
59
  `Timed out waiting for transaction ${signature} to reach ${commitment} commitment.`
35
60
  );
36
61
  } catch (cause) {
37
62
  throw errors.normalizeSolanaError(cause, "RPC_FAILURE");
38
63
  }
39
- if (result.value.err) {
40
- throw errors.createSolanaError(
41
- "RPC_FAILURE",
42
- `Transaction ${signature} failed to reach ${commitment} commitment.`,
43
- { cause: result.value.err }
44
- );
45
- }
46
- return {
47
- signature,
48
- commitment,
49
- result
50
- };
51
64
  }
52
- async function signAndSendRawTransaction(connection, wallet, transaction, options) {
53
- const signedTransaction = await wallet.signTransaction(transaction);
54
- const rawTransaction = signedTransaction.serialize();
55
- return connection.sendRawTransaction(rawTransaction, options);
65
+ function toBase64WireTransaction(transaction) {
66
+ return kit.getBase64EncodedWireTransaction(kit.getTransactionDecoder().decode(transaction));
67
+ }
68
+ function hasReachedCommitment(actualStatus, targetCommitment) {
69
+ if (!actualStatus) {
70
+ return false;
71
+ }
72
+ return (COMMITMENT_RANK[actualStatus] ?? 0) >= (COMMITMENT_RANK[targetCommitment] ?? 0);
56
73
  }
57
- function isMobileWalletAdapterWallet(wallet) {
58
- return wallet.source === "mobile-wallet-adapter";
74
+ function wait(ms) {
75
+ return new Promise((resolve) => {
76
+ setTimeout(resolve, ms);
77
+ });
59
78
  }
60
79
 
61
80
  exports.confirmTransactionSignature = confirmTransactionSignature;
@@ -1,23 +1,17 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- import { Connection, TransactionSignature } from '@solana/web3-compat';
4
- import { C as ConfirmTransactionOptions, T as TransactionConfirmation, h as SolanaWallet, g as SolanaTransaction, S as SendTransactionOptions } from './shared/core.DAUuCWrr.cjs';
5
- import '@solana/kit';
1
+ import { Signature } from '@solana/kit';
2
+ import { b as SolanaClient, C as ConfirmTransactionOptions, T as TransactionConfirmation, h as SolanaWallet, g as SolanaTransaction, S as SendTransactionOptions } from './shared/core.DMgTrB_2.cjs';
6
3
 
7
4
  /**
8
- * Sign and send a transaction through a connected wallet using the legacy
9
- * web3-compat `Connection` API.
5
+ * Sign and send a transaction through a connected wallet.
10
6
  *
11
- * @deprecated Kit transactions are sent with `client.sendTransaction([...])`
12
- * once the client has a payer; see `@vue-solana/core/kit`.
7
+ * Walks through the supported kit RPC path: the wallet signs the raw wire
8
+ * transaction, and the client sends it via `client.rpc.sendTransaction`.
13
9
  */
14
- declare function signAndSendTransaction(connection: Connection, wallet: SolanaWallet, transaction: SolanaTransaction, options?: SendTransactionOptions): Promise<TransactionSignature>;
10
+ declare function signAndSendTransaction(client: SolanaClient, wallet: SolanaWallet, transaction: SolanaTransaction, options?: SendTransactionOptions): Promise<Signature>;
15
11
  /**
16
- * Confirm a transaction signature using the legacy `Connection` API.
17
- *
18
- * @deprecated Use `client.rpc.getSignatureStatuses([...]).send()` from
19
- * `@vue-solana/core/kit` instead.
12
+ * Confirm a transaction signature against the kit RPC until it reaches the
13
+ * requested commitment.
20
14
  */
21
- declare function confirmTransactionSignature(connection: Connection, signature: TransactionSignature, options?: ConfirmTransactionOptions): Promise<TransactionConfirmation>;
15
+ declare function confirmTransactionSignature(client: SolanaClient, signature: Signature, options?: ConfirmTransactionOptions): Promise<TransactionConfirmation>;
22
16
 
23
17
  export { confirmTransactionSignature, signAndSendTransaction };
@@ -1,23 +1,17 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- import { Connection, TransactionSignature } from '@solana/web3-compat';
4
- import { C as ConfirmTransactionOptions, T as TransactionConfirmation, h as SolanaWallet, g as SolanaTransaction, S as SendTransactionOptions } from './shared/core.DAUuCWrr.mjs';
5
- import '@solana/kit';
1
+ import { Signature } from '@solana/kit';
2
+ import { b as SolanaClient, C as ConfirmTransactionOptions, T as TransactionConfirmation, h as SolanaWallet, g as SolanaTransaction, S as SendTransactionOptions } from './shared/core.DMgTrB_2.mjs';
6
3
 
7
4
  /**
8
- * Sign and send a transaction through a connected wallet using the legacy
9
- * web3-compat `Connection` API.
5
+ * Sign and send a transaction through a connected wallet.
10
6
  *
11
- * @deprecated Kit transactions are sent with `client.sendTransaction([...])`
12
- * once the client has a payer; see `@vue-solana/core/kit`.
7
+ * Walks through the supported kit RPC path: the wallet signs the raw wire
8
+ * transaction, and the client sends it via `client.rpc.sendTransaction`.
13
9
  */
14
- declare function signAndSendTransaction(connection: Connection, wallet: SolanaWallet, transaction: SolanaTransaction, options?: SendTransactionOptions): Promise<TransactionSignature>;
10
+ declare function signAndSendTransaction(client: SolanaClient, wallet: SolanaWallet, transaction: SolanaTransaction, options?: SendTransactionOptions): Promise<Signature>;
15
11
  /**
16
- * Confirm a transaction signature using the legacy `Connection` API.
17
- *
18
- * @deprecated Use `client.rpc.getSignatureStatuses([...]).send()` from
19
- * `@vue-solana/core/kit` instead.
12
+ * Confirm a transaction signature against the kit RPC until it reaches the
13
+ * requested commitment.
20
14
  */
21
- declare function confirmTransactionSignature(connection: Connection, signature: TransactionSignature, options?: ConfirmTransactionOptions): Promise<TransactionConfirmation>;
15
+ declare function confirmTransactionSignature(client: SolanaClient, signature: Signature, options?: ConfirmTransactionOptions): Promise<TransactionConfirmation>;
22
16
 
23
17
  export { confirmTransactionSignature, signAndSendTransaction };
@@ -1,23 +1,17 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- import { Connection, TransactionSignature } from '@solana/web3-compat';
4
- import { C as ConfirmTransactionOptions, T as TransactionConfirmation, h as SolanaWallet, g as SolanaTransaction, S as SendTransactionOptions } from './shared/core.DAUuCWrr.js';
5
- import '@solana/kit';
1
+ import { Signature } from '@solana/kit';
2
+ import { b as SolanaClient, C as ConfirmTransactionOptions, T as TransactionConfirmation, h as SolanaWallet, g as SolanaTransaction, S as SendTransactionOptions } from './shared/core.DMgTrB_2.js';
6
3
 
7
4
  /**
8
- * Sign and send a transaction through a connected wallet using the legacy
9
- * web3-compat `Connection` API.
5
+ * Sign and send a transaction through a connected wallet.
10
6
  *
11
- * @deprecated Kit transactions are sent with `client.sendTransaction([...])`
12
- * once the client has a payer; see `@vue-solana/core/kit`.
7
+ * Walks through the supported kit RPC path: the wallet signs the raw wire
8
+ * transaction, and the client sends it via `client.rpc.sendTransaction`.
13
9
  */
14
- declare function signAndSendTransaction(connection: Connection, wallet: SolanaWallet, transaction: SolanaTransaction, options?: SendTransactionOptions): Promise<TransactionSignature>;
10
+ declare function signAndSendTransaction(client: SolanaClient, wallet: SolanaWallet, transaction: SolanaTransaction, options?: SendTransactionOptions): Promise<Signature>;
15
11
  /**
16
- * Confirm a transaction signature using the legacy `Connection` API.
17
- *
18
- * @deprecated Use `client.rpc.getSignatureStatuses([...]).send()` from
19
- * `@vue-solana/core/kit` instead.
12
+ * Confirm a transaction signature against the kit RPC until it reaches the
13
+ * requested commitment.
20
14
  */
21
- declare function confirmTransactionSignature(connection: Connection, signature: TransactionSignature, options?: ConfirmTransactionOptions): Promise<TransactionConfirmation>;
15
+ declare function confirmTransactionSignature(client: SolanaClient, signature: Signature, options?: ConfirmTransactionOptions): Promise<TransactionConfirmation>;
22
16
 
23
17
  export { confirmTransactionSignature, signAndSendTransaction };
@@ -1,59 +1,78 @@
1
- import { normalizeSolanaError, createSolanaError } from './errors.mjs';
2
- import { withSolanaTimeout } from './timeout.mjs';
1
+ import { getBase64EncodedWireTransaction, getTransactionDecoder } from '@solana/kit';
2
+ import { createSolanaError, normalizeSolanaError } from './errors.mjs';
3
3
  import { assertWalletConnected, assertWalletCanSign } from './wallet.mjs';
4
4
 
5
5
  const DEFAULT_CONFIRMATION_COMMITMENT = "confirmed";
6
6
  const DEFAULT_CONFIRMATION_TIMEOUT_MS = 6e4;
7
- async function signAndSendTransaction(connection, wallet, transaction, options) {
7
+ const SIGNATURE_STATUS_POLL_INTERVAL_MS = 1500;
8
+ const COMMITMENT_RANK = { processed: 0, confirmed: 1, finalized: 2 };
9
+ async function signAndSendTransaction(client, wallet, transaction, options) {
8
10
  try {
9
11
  assertWalletConnected(wallet);
10
- if (isMobileWalletAdapterWallet(wallet) && wallet.signTransaction) {
11
- assertWalletCanSign(wallet);
12
- return await signAndSendRawTransaction(connection, wallet, transaction, options);
13
- }
14
12
  if (wallet.signAndSendTransaction) {
15
13
  const result = await wallet.signAndSendTransaction(transaction, options);
16
14
  return result.signature;
17
15
  }
18
16
  assertWalletCanSign(wallet);
19
- return await signAndSendRawTransaction(connection, wallet, transaction, options);
17
+ const signedTransaction = await wallet.signTransaction(transaction);
18
+ const base64Transaction = toBase64WireTransaction(signedTransaction);
19
+ const { maxRetries, minContextSlot, preflightCommitment, skipPreflight } = options ?? {};
20
+ return await client.rpc.sendTransaction(base64Transaction, {
21
+ encoding: "base64",
22
+ maxRetries,
23
+ minContextSlot,
24
+ preflightCommitment,
25
+ skipPreflight
26
+ }).send();
20
27
  } catch (cause) {
21
28
  throw normalizeSolanaError(cause, "RPC_FAILURE");
22
29
  }
23
30
  }
24
- async function confirmTransactionSignature(connection, signature, options = {}) {
31
+ async function confirmTransactionSignature(client, signature, options = {}) {
25
32
  const commitment = options.commitment ?? DEFAULT_CONFIRMATION_COMMITMENT;
26
- const confirmation = connection.confirmTransaction(signature, commitment);
27
- let result;
33
+ const timeoutMs = options.timeoutMs ?? DEFAULT_CONFIRMATION_TIMEOUT_MS;
34
+ let elapsedMs = 0;
28
35
  try {
29
- result = await withSolanaTimeout(
30
- confirmation,
31
- options.timeoutMs ?? DEFAULT_CONFIRMATION_TIMEOUT_MS,
36
+ while (elapsedMs < timeoutMs) {
37
+ const response = await client.rpc.getSignatureStatuses([signature]).send();
38
+ const [status] = response.value;
39
+ if (!status) {
40
+ throw new Error(`Transaction ${signature} was not found.`);
41
+ }
42
+ if (status.err) {
43
+ throw createSolanaError(
44
+ "RPC_FAILURE",
45
+ `Transaction ${signature} failed to reach ${commitment} commitment.`,
46
+ { cause: status.err }
47
+ );
48
+ }
49
+ if (hasReachedCommitment(status.confirmationStatus, commitment)) {
50
+ return { signature, commitment, status };
51
+ }
52
+ await wait(SIGNATURE_STATUS_POLL_INTERVAL_MS);
53
+ elapsedMs += SIGNATURE_STATUS_POLL_INTERVAL_MS;
54
+ }
55
+ throw createSolanaError(
56
+ "TRANSACTION_TIMEOUT",
32
57
  `Timed out waiting for transaction ${signature} to reach ${commitment} commitment.`
33
58
  );
34
59
  } catch (cause) {
35
60
  throw normalizeSolanaError(cause, "RPC_FAILURE");
36
61
  }
37
- if (result.value.err) {
38
- throw createSolanaError(
39
- "RPC_FAILURE",
40
- `Transaction ${signature} failed to reach ${commitment} commitment.`,
41
- { cause: result.value.err }
42
- );
43
- }
44
- return {
45
- signature,
46
- commitment,
47
- result
48
- };
49
62
  }
50
- async function signAndSendRawTransaction(connection, wallet, transaction, options) {
51
- const signedTransaction = await wallet.signTransaction(transaction);
52
- const rawTransaction = signedTransaction.serialize();
53
- return connection.sendRawTransaction(rawTransaction, options);
63
+ function toBase64WireTransaction(transaction) {
64
+ return getBase64EncodedWireTransaction(getTransactionDecoder().decode(transaction));
65
+ }
66
+ function hasReachedCommitment(actualStatus, targetCommitment) {
67
+ if (!actualStatus) {
68
+ return false;
69
+ }
70
+ return (COMMITMENT_RANK[actualStatus] ?? 0) >= (COMMITMENT_RANK[targetCommitment] ?? 0);
54
71
  }
55
- function isMobileWalletAdapterWallet(wallet) {
56
- return wallet.source === "mobile-wallet-adapter";
72
+ function wait(ms) {
73
+ return new Promise((resolve) => {
74
+ setTimeout(resolve, ms);
75
+ });
57
76
  }
58
77
 
59
78
  export { confirmTransactionSignature, signAndSendTransaction };
package/dist/types.d.cts CHANGED
@@ -1,5 +1,2 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- import '@solana/web3-compat';
4
- export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, c as SolanaCluster, d as SolanaConfig, e as SolanaContext, f as SolanaSignMessageResult, g as SolanaTransaction, h as SolanaWallet, i as SolanaWalletInfo, T as TransactionConfirmation } from './shared/core.DAUuCWrr.cjs';
5
1
  import '@solana/kit';
2
+ export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, c as SolanaCluster, d as SolanaConfig, e as SolanaContext, f as SolanaSignMessageResult, g as SolanaTransaction, h as SolanaWallet, i as SolanaWalletInfo, T as TransactionConfirmation, j as TransactionStatus } from './shared/core.DMgTrB_2.cjs';
package/dist/types.d.mts CHANGED
@@ -1,5 +1,2 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- import '@solana/web3-compat';
4
- export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, c as SolanaCluster, d as SolanaConfig, e as SolanaContext, f as SolanaSignMessageResult, g as SolanaTransaction, h as SolanaWallet, i as SolanaWalletInfo, T as TransactionConfirmation } from './shared/core.DAUuCWrr.mjs';
5
1
  import '@solana/kit';
2
+ export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, c as SolanaCluster, d as SolanaConfig, e as SolanaContext, f as SolanaSignMessageResult, g as SolanaTransaction, h as SolanaWallet, i as SolanaWalletInfo, T as TransactionConfirmation, j as TransactionStatus } from './shared/core.DMgTrB_2.mjs';
package/dist/types.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- import '@solana/web3-compat';
4
- export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, c as SolanaCluster, d as SolanaConfig, e as SolanaContext, f as SolanaSignMessageResult, g as SolanaTransaction, h as SolanaWallet, i as SolanaWalletInfo, T as TransactionConfirmation } from './shared/core.DAUuCWrr.js';
5
1
  import '@solana/kit';
2
+ export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, c as SolanaCluster, d as SolanaConfig, e as SolanaContext, f as SolanaSignMessageResult, g as SolanaTransaction, h as SolanaWallet, i as SolanaWalletInfo, T as TransactionConfirmation, j as TransactionStatus } from './shared/core.DMgTrB_2.js';
@@ -1,12 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const discovery = require('./shared/core.BQoh-5Wu.cjs');
3
+ const discovery = require('./shared/core.Cu_gaUSn.cjs');
4
4
  require('@wallet-standard/features');
5
5
  require('@solana/wallet-standard-features');
6
- require('@solana/web3-compat');
7
6
  require('bs58');
8
- require('./wallet.cjs');
9
- require('./errors.cjs');
10
7
  require('@wallet-standard/app');
11
8
 
12
9
 
@@ -1,8 +1,5 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
1
  import { WalletAccount, Wallet } from '@wallet-standard/base';
4
- import { a as SolanaChain, i as SolanaWalletInfo, h as SolanaWallet, c as SolanaCluster } from './shared/core.DAUuCWrr.cjs';
5
- import '@solana/web3-compat';
2
+ import { a as SolanaChain, i as SolanaWalletInfo, h as SolanaWallet, c as SolanaCluster } from './shared/core.DMgTrB_2.cjs';
6
3
  import '@solana/kit';
7
4
 
8
5
  interface AdaptSolanaWalletOptions {
@@ -1,8 +1,5 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
1
  import { WalletAccount, Wallet } from '@wallet-standard/base';
4
- import { a as SolanaChain, i as SolanaWalletInfo, h as SolanaWallet, c as SolanaCluster } from './shared/core.DAUuCWrr.mjs';
5
- import '@solana/web3-compat';
2
+ import { a as SolanaChain, i as SolanaWalletInfo, h as SolanaWallet, c as SolanaCluster } from './shared/core.DMgTrB_2.mjs';
6
3
  import '@solana/kit';
7
4
 
8
5
  interface AdaptSolanaWalletOptions {
@@ -1,8 +1,5 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
1
  import { WalletAccount, Wallet } from '@wallet-standard/base';
4
- import { a as SolanaChain, i as SolanaWalletInfo, h as SolanaWallet, c as SolanaCluster } from './shared/core.DAUuCWrr.js';
5
- import '@solana/web3-compat';
2
+ import { a as SolanaChain, i as SolanaWalletInfo, h as SolanaWallet, c as SolanaCluster } from './shared/core.DMgTrB_2.js';
6
3
  import '@solana/kit';
7
4
 
8
5
  interface AdaptSolanaWalletOptions {
@@ -1,8 +1,5 @@
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.DjbtrJWl.mjs';
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.BOHiMZiM.mjs';
2
2
  import '@wallet-standard/features';
3
3
  import '@solana/wallet-standard-features';
4
- import '@solana/web3-compat';
5
4
  import 'bs58';
6
- import './wallet.mjs';
7
- import './errors.mjs';
8
5
  import '@wallet-standard/app';
package/dist/wallet.d.cts CHANGED
@@ -1,8 +1,5 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- import { h as SolanaWallet } from './shared/core.DAUuCWrr.cjs';
1
+ import { h as SolanaWallet } from './shared/core.DMgTrB_2.cjs';
4
2
  import { SolanaError } from './errors.cjs';
5
- import '@solana/web3-compat';
6
3
  import '@solana/kit';
7
4
 
8
5
  type SolanaWalletErrorCode = "NO_WALLET_SELECTED" | "WALLET_NOT_CONNECTED" | "WALLET_FEATURE_UNSUPPORTED";
package/dist/wallet.d.mts CHANGED
@@ -1,8 +1,5 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- import { h as SolanaWallet } from './shared/core.DAUuCWrr.mjs';
1
+ import { h as SolanaWallet } from './shared/core.DMgTrB_2.mjs';
4
2
  import { SolanaError } from './errors.mjs';
5
- import '@solana/web3-compat';
6
3
  import '@solana/kit';
7
4
 
8
5
  type SolanaWalletErrorCode = "NO_WALLET_SELECTED" | "WALLET_NOT_CONNECTED" | "WALLET_FEATURE_UNSUPPORTED";
package/dist/wallet.d.ts CHANGED
@@ -1,8 +1,5 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- import { h as SolanaWallet } from './shared/core.DAUuCWrr.js';
1
+ import { h as SolanaWallet } from './shared/core.DMgTrB_2.js';
4
2
  import { SolanaError } from './errors.js';
5
- import '@solana/web3-compat';
6
3
  import '@solana/kit';
7
4
 
8
5
  type SolanaWalletErrorCode = "NO_WALLET_SELECTED" | "WALLET_NOT_CONNECTED" | "WALLET_FEATURE_UNSUPPORTED";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-solana/core",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "description": "Framework-agnostic primitives for Vue Solana libraries.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -95,16 +95,6 @@
95
95
  "import": "./dist/wallet-standard.mjs",
96
96
  "require": "./dist/wallet-standard.cjs"
97
97
  },
98
- "./web3": {
99
- "types": "./dist/web3.d.ts",
100
- "import": "./dist/web3.mjs",
101
- "require": "./dist/web3.cjs"
102
- },
103
- "./spl-token": {
104
- "types": "./dist/spl-token.d.ts",
105
- "import": "./dist/spl-token.mjs",
106
- "require": "./dist/spl-token.cjs"
107
- },
108
98
  "./token-accounts": {
109
99
  "types": "./dist/token-accounts.d.ts",
110
100
  "import": "./dist/token-accounts.mjs",
@@ -122,9 +112,7 @@
122
112
  "@solana-mobile/wallet-standard-mobile": "^0.5.3",
123
113
  "@solana/kit": "^8.3.0",
124
114
  "@solana/kit-plugin-rpc": "^0.19.0",
125
- "@solana/spl-token": "^0.4.15",
126
115
  "@solana/wallet-standard-features": "^1.3.0",
127
- "@solana/web3-compat": "^0.0.21",
128
116
  "@wallet-standard/app": "^1.1.1",
129
117
  "@wallet-standard/base": "^1.1.1",
130
118
  "@wallet-standard/features": "^1.1.1",
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- const splToken = require('@solana/spl-token');
4
-
5
-
6
-
7
- exports.AccountState = splToken.AccountState;
8
- exports.TOKEN_2022_PROGRAM_ID = splToken.TOKEN_2022_PROGRAM_ID;
9
- exports.TOKEN_PROGRAM_ID = splToken.TOKEN_PROGRAM_ID;
10
- exports.getAssociatedTokenAddressSync = splToken.getAssociatedTokenAddressSync;
11
- exports.unpackAccount = splToken.unpackAccount;
12
- exports.unpackMint = splToken.unpackMint;
@@ -1,4 +0,0 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- export { AccountState, Mint, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, Account as TokenAccount, getAssociatedTokenAddressSync, unpackAccount, unpackMint } from '@solana/spl-token';
4
- import '@solana/web3-compat';
@@ -1,4 +0,0 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- export { AccountState, Mint, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, Account as TokenAccount, getAssociatedTokenAddressSync, unpackAccount, unpackMint } from '@solana/spl-token';
4
- import '@solana/web3-compat';
@@ -1,4 +0,0 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- export { AccountState, Mint, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, Account as TokenAccount, getAssociatedTokenAddressSync, unpackAccount, unpackMint } from '@solana/spl-token';
4
- import '@solana/web3-compat';
@@ -1 +0,0 @@
1
- export { AccountState, TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync, unpackAccount, unpackMint } from '@solana/spl-token';
package/dist/web3.cjs DELETED
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- const web3Compat = require('@solana/web3-compat');
4
-
5
-
6
-
7
- exports.Connection = web3Compat.Connection;
8
- exports.Keypair = web3Compat.Keypair;
9
- exports.PublicKey = web3Compat.PublicKey;
10
- exports.SystemProgram = web3Compat.SystemProgram;
11
- exports.Transaction = web3Compat.Transaction;
12
- exports.TransactionInstruction = web3Compat.TransactionInstruction;
13
- exports.VersionedTransaction = web3Compat.VersionedTransaction;
package/dist/web3.d.cts DELETED
@@ -1,3 +0,0 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- export { AccountInfo, Commitment, Connection, Keypair, PublicKey, RpcResponseAndContext, SendOptions, SignatureResult, SignatureStatus, SystemProgram, Transaction, TransactionInstruction, TransactionSignature, VersionedTransaction } from '@solana/web3-compat';
package/dist/web3.d.mts DELETED
@@ -1,3 +0,0 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- export { AccountInfo, Commitment, Connection, Keypair, PublicKey, RpcResponseAndContext, SendOptions, SignatureResult, SignatureStatus, SystemProgram, Transaction, TransactionInstruction, TransactionSignature, VersionedTransaction } from '@solana/web3-compat';
package/dist/web3.d.ts DELETED
@@ -1,3 +0,0 @@
1
- /// <reference path="../types/web3-compat.d.ts" />
2
- /// <reference path="../types/buffer.d.ts" />
3
- export { AccountInfo, Commitment, Connection, Keypair, PublicKey, RpcResponseAndContext, SendOptions, SignatureResult, SignatureStatus, SystemProgram, Transaction, TransactionInstruction, TransactionSignature, VersionedTransaction } from '@solana/web3-compat';
package/dist/web3.mjs DELETED
@@ -1 +0,0 @@
1
- export { Connection, Keypair, PublicKey, SystemProgram, Transaction, TransactionInstruction, VersionedTransaction } from '@solana/web3-compat';