@vue-solana/core 2.0.0 → 2.2.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.
- package/README.md +23 -19
- package/dist/action.cjs +15 -0
- package/dist/action.d.cts +28 -0
- package/dist/action.d.mts +28 -0
- package/dist/action.d.ts +28 -0
- package/dist/action.mjs +12 -0
- package/dist/clusters.d.cts +1 -1
- package/dist/clusters.d.mts +1 -1
- package/dist/clusters.d.ts +1 -1
- package/dist/index.cjs +12 -2
- package/dist/index.d.cts +4 -3
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.mjs +5 -4
- package/dist/ios-wallet.d.cts +1 -1
- package/dist/ios-wallet.d.mts +1 -1
- package/dist/ios-wallet.d.ts +1 -1
- package/dist/kit.cjs +5 -1
- package/dist/kit.d.cts +2 -2
- package/dist/kit.d.mts +2 -2
- package/dist/kit.d.ts +2 -2
- package/dist/kit.mjs +3 -3
- package/dist/mobile-wallet.d.cts +1 -1
- package/dist/mobile-wallet.d.mts +1 -1
- package/dist/mobile-wallet.d.ts +1 -1
- package/dist/rpc.d.cts +1 -1
- package/dist/rpc.d.mts +1 -1
- package/dist/rpc.d.ts +1 -1
- package/dist/shared/{core.DMgTrB_2.d.ts → core.Bk0PszDR.d.cts} +47 -15
- package/dist/shared/{core.DMgTrB_2.d.cts → core.Bk0PszDR.d.mts} +47 -15
- package/dist/shared/{core.DMgTrB_2.d.mts → core.Bk0PszDR.d.ts} +47 -15
- package/dist/shared/{core.BOHiMZiM.mjs → core.DEcQDbtz.mjs} +82 -4
- package/dist/shared/{core.Cu_gaUSn.cjs → core.DjxUirkw.cjs} +81 -3
- package/dist/token-accounts.d.cts +1 -1
- package/dist/token-accounts.d.mts +1 -1
- package/dist/token-accounts.d.ts +1 -1
- package/dist/transaction.d.cts +1 -1
- package/dist/transaction.d.mts +1 -1
- package/dist/transaction.d.ts +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/wallet-standard.cjs +1 -1
- package/dist/wallet-standard.d.cts +1 -1
- package/dist/wallet-standard.d.mts +1 -1
- package/dist/wallet-standard.d.ts +1 -1
- package/dist/wallet-standard.mjs +1 -1
- package/dist/wallet.cjs +33 -0
- package/dist/wallet.d.cts +5 -2
- package/dist/wallet.d.mts +5 -2
- package/dist/wallet.d.ts +5 -2
- package/dist/wallet.mjs +31 -1
- package/package.json +6 -1
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import * as _solana_kit from '@solana/kit';
|
|
2
2
|
import { Commitment, Slot, Address, Signature } from '@solana/kit';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Create a @solana/kit client for the given Solana configuration.
|
|
6
|
-
*
|
|
7
|
-
* The returned client exposes read-only `rpc` and `rpcSubscriptions`; use
|
|
8
|
-
* `client.rpc.getSlot().send()` and friends instead of the legacy
|
|
9
|
-
* `connection` APIs.
|
|
10
|
-
*/
|
|
11
|
-
declare function createSolanaClient(config?: SolanaConfig): _solana_kit.Client<_solana_kit.ExtendedClient<object, {
|
|
12
|
-
rpc: _solana_kit.Rpc<_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetAgGenesisCertApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetTransactionsForAddressApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi>;
|
|
13
|
-
rpcSubscriptions: _solana_kit.RpcSubscriptions<_solana_kit.SolanaRpcSubscriptionsApi>;
|
|
14
|
-
}>>;
|
|
15
|
-
type SolanaClient = ReturnType<typeof createSolanaClient>;
|
|
16
|
-
|
|
17
4
|
type SolanaCluster = "mainnet-beta" | "testnet" | "devnet" | "localnet";
|
|
18
5
|
type SolanaChain = "solana:mainnet" | "solana:testnet" | "solana:devnet" | "solana:localnet";
|
|
19
6
|
interface SolanaConfig {
|
|
@@ -34,6 +21,33 @@ interface SolanaSignMessageResult {
|
|
|
34
21
|
signedMessage: Uint8Array;
|
|
35
22
|
signature: Uint8Array;
|
|
36
23
|
}
|
|
24
|
+
interface SolanaSignInAccount {
|
|
25
|
+
address: Address;
|
|
26
|
+
publicKey: Uint8Array;
|
|
27
|
+
chains: string[];
|
|
28
|
+
label?: string;
|
|
29
|
+
icon?: string;
|
|
30
|
+
}
|
|
31
|
+
interface SolanaSignInResult {
|
|
32
|
+
account: SolanaSignInAccount;
|
|
33
|
+
signedMessage: Uint8Array;
|
|
34
|
+
signature: Uint8Array;
|
|
35
|
+
signatureType?: "ed25519";
|
|
36
|
+
}
|
|
37
|
+
interface SolanaSignInInput {
|
|
38
|
+
domain?: string;
|
|
39
|
+
address?: string;
|
|
40
|
+
statement?: string;
|
|
41
|
+
uri?: string;
|
|
42
|
+
version?: string;
|
|
43
|
+
chainId?: string;
|
|
44
|
+
nonce?: string;
|
|
45
|
+
issuedAt?: string;
|
|
46
|
+
expirationTime?: string;
|
|
47
|
+
notBefore?: string;
|
|
48
|
+
requestId?: string;
|
|
49
|
+
resources?: readonly string[];
|
|
50
|
+
}
|
|
37
51
|
interface SolanaWallet {
|
|
38
52
|
publicKey: Address | null;
|
|
39
53
|
connected: boolean;
|
|
@@ -44,11 +58,14 @@ interface SolanaWallet {
|
|
|
44
58
|
connect: () => Promise<void>;
|
|
45
59
|
disconnect: () => Promise<void>;
|
|
46
60
|
signMessage?: (message: Uint8Array) => Promise<SolanaSignMessageResult>;
|
|
61
|
+
signIn?: (input?: SolanaSignInInput) => Promise<SolanaSignInResult>;
|
|
47
62
|
signTransaction?: (transaction: SolanaTransaction) => Promise<SolanaTransaction>;
|
|
48
63
|
signAllTransactions?: (transactions: SolanaTransaction[]) => Promise<SolanaTransaction[]>;
|
|
64
|
+
signTransactions?: (transactions: SolanaTransaction[]) => Promise<SolanaTransaction[]>;
|
|
49
65
|
signAndSendTransaction?: (transaction: SolanaTransaction, options?: SendTransactionOptions) => Promise<{
|
|
50
66
|
signature: string;
|
|
51
67
|
}>;
|
|
68
|
+
signAndSendTransactions?: (transactions: SolanaTransaction[], options?: SendTransactionOptions) => Promise<string[]>;
|
|
52
69
|
}
|
|
53
70
|
interface SolanaWalletInfo {
|
|
54
71
|
name: string;
|
|
@@ -62,6 +79,7 @@ interface SolanaWalletInfo {
|
|
|
62
79
|
capabilities?: {
|
|
63
80
|
connect?: boolean;
|
|
64
81
|
disconnect?: boolean;
|
|
82
|
+
signIn?: boolean;
|
|
65
83
|
signMessage?: boolean;
|
|
66
84
|
signTransaction?: boolean;
|
|
67
85
|
signAllTransactions?: boolean;
|
|
@@ -98,5 +116,19 @@ interface TransactionConfirmation {
|
|
|
98
116
|
status: TransactionStatus;
|
|
99
117
|
}
|
|
100
118
|
|
|
101
|
-
|
|
102
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Create a @solana/kit client for the given Solana configuration.
|
|
121
|
+
*
|
|
122
|
+
* The returned client exposes read-only `rpc` and `rpcSubscriptions`; use
|
|
123
|
+
* `client.rpc.getSlot().send()` and friends instead of the legacy
|
|
124
|
+
* `connection` APIs.
|
|
125
|
+
*/
|
|
126
|
+
declare function createSolanaClient(config?: SolanaConfig): _solana_kit.Client<{
|
|
127
|
+
rpc: _solana_kit.Rpc<_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetAgGenesisCertApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetTransactionsForAddressApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi>;
|
|
128
|
+
rpcSubscriptions: _solana_kit.RpcSubscriptions<_solana_kit.SolanaRpcSubscriptionsApi>;
|
|
129
|
+
airdrop: (address: _solana_kit.Address, amount: _solana_kit.Lamports, abortSignal?: AbortSignal) => Promise<_solana_kit.Signature | undefined>;
|
|
130
|
+
}>;
|
|
131
|
+
type SolanaClient = ReturnType<typeof createSolanaClient>;
|
|
132
|
+
|
|
133
|
+
export { createSolanaClient as n };
|
|
134
|
+
export type { ConfirmTransactionOptions as C, SendTransactionOptions as S, TransactionConfirmation as T, SolanaChain as a, SolanaClient as b, SolanaCluster as c, SolanaConfig as d, SolanaContext as e, SolanaSignInAccount as f, SolanaSignInInput as g, SolanaSignInResult as h, SolanaSignMessageResult as i, SolanaTransaction as j, SolanaWallet as k, SolanaWalletInfo as l, TransactionStatus as m };
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import * as _solana_kit from '@solana/kit';
|
|
2
2
|
import { Commitment, Slot, Address, Signature } from '@solana/kit';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Create a @solana/kit client for the given Solana configuration.
|
|
6
|
-
*
|
|
7
|
-
* The returned client exposes read-only `rpc` and `rpcSubscriptions`; use
|
|
8
|
-
* `client.rpc.getSlot().send()` and friends instead of the legacy
|
|
9
|
-
* `connection` APIs.
|
|
10
|
-
*/
|
|
11
|
-
declare function createSolanaClient(config?: SolanaConfig): _solana_kit.Client<_solana_kit.ExtendedClient<object, {
|
|
12
|
-
rpc: _solana_kit.Rpc<_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetAgGenesisCertApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetTransactionsForAddressApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi>;
|
|
13
|
-
rpcSubscriptions: _solana_kit.RpcSubscriptions<_solana_kit.SolanaRpcSubscriptionsApi>;
|
|
14
|
-
}>>;
|
|
15
|
-
type SolanaClient = ReturnType<typeof createSolanaClient>;
|
|
16
|
-
|
|
17
4
|
type SolanaCluster = "mainnet-beta" | "testnet" | "devnet" | "localnet";
|
|
18
5
|
type SolanaChain = "solana:mainnet" | "solana:testnet" | "solana:devnet" | "solana:localnet";
|
|
19
6
|
interface SolanaConfig {
|
|
@@ -34,6 +21,33 @@ interface SolanaSignMessageResult {
|
|
|
34
21
|
signedMessage: Uint8Array;
|
|
35
22
|
signature: Uint8Array;
|
|
36
23
|
}
|
|
24
|
+
interface SolanaSignInAccount {
|
|
25
|
+
address: Address;
|
|
26
|
+
publicKey: Uint8Array;
|
|
27
|
+
chains: string[];
|
|
28
|
+
label?: string;
|
|
29
|
+
icon?: string;
|
|
30
|
+
}
|
|
31
|
+
interface SolanaSignInResult {
|
|
32
|
+
account: SolanaSignInAccount;
|
|
33
|
+
signedMessage: Uint8Array;
|
|
34
|
+
signature: Uint8Array;
|
|
35
|
+
signatureType?: "ed25519";
|
|
36
|
+
}
|
|
37
|
+
interface SolanaSignInInput {
|
|
38
|
+
domain?: string;
|
|
39
|
+
address?: string;
|
|
40
|
+
statement?: string;
|
|
41
|
+
uri?: string;
|
|
42
|
+
version?: string;
|
|
43
|
+
chainId?: string;
|
|
44
|
+
nonce?: string;
|
|
45
|
+
issuedAt?: string;
|
|
46
|
+
expirationTime?: string;
|
|
47
|
+
notBefore?: string;
|
|
48
|
+
requestId?: string;
|
|
49
|
+
resources?: readonly string[];
|
|
50
|
+
}
|
|
37
51
|
interface SolanaWallet {
|
|
38
52
|
publicKey: Address | null;
|
|
39
53
|
connected: boolean;
|
|
@@ -44,11 +58,14 @@ interface SolanaWallet {
|
|
|
44
58
|
connect: () => Promise<void>;
|
|
45
59
|
disconnect: () => Promise<void>;
|
|
46
60
|
signMessage?: (message: Uint8Array) => Promise<SolanaSignMessageResult>;
|
|
61
|
+
signIn?: (input?: SolanaSignInInput) => Promise<SolanaSignInResult>;
|
|
47
62
|
signTransaction?: (transaction: SolanaTransaction) => Promise<SolanaTransaction>;
|
|
48
63
|
signAllTransactions?: (transactions: SolanaTransaction[]) => Promise<SolanaTransaction[]>;
|
|
64
|
+
signTransactions?: (transactions: SolanaTransaction[]) => Promise<SolanaTransaction[]>;
|
|
49
65
|
signAndSendTransaction?: (transaction: SolanaTransaction, options?: SendTransactionOptions) => Promise<{
|
|
50
66
|
signature: string;
|
|
51
67
|
}>;
|
|
68
|
+
signAndSendTransactions?: (transactions: SolanaTransaction[], options?: SendTransactionOptions) => Promise<string[]>;
|
|
52
69
|
}
|
|
53
70
|
interface SolanaWalletInfo {
|
|
54
71
|
name: string;
|
|
@@ -62,6 +79,7 @@ interface SolanaWalletInfo {
|
|
|
62
79
|
capabilities?: {
|
|
63
80
|
connect?: boolean;
|
|
64
81
|
disconnect?: boolean;
|
|
82
|
+
signIn?: boolean;
|
|
65
83
|
signMessage?: boolean;
|
|
66
84
|
signTransaction?: boolean;
|
|
67
85
|
signAllTransactions?: boolean;
|
|
@@ -98,5 +116,19 @@ interface TransactionConfirmation {
|
|
|
98
116
|
status: TransactionStatus;
|
|
99
117
|
}
|
|
100
118
|
|
|
101
|
-
|
|
102
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Create a @solana/kit client for the given Solana configuration.
|
|
121
|
+
*
|
|
122
|
+
* The returned client exposes read-only `rpc` and `rpcSubscriptions`; use
|
|
123
|
+
* `client.rpc.getSlot().send()` and friends instead of the legacy
|
|
124
|
+
* `connection` APIs.
|
|
125
|
+
*/
|
|
126
|
+
declare function createSolanaClient(config?: SolanaConfig): _solana_kit.Client<{
|
|
127
|
+
rpc: _solana_kit.Rpc<_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetAgGenesisCertApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetTransactionsForAddressApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi>;
|
|
128
|
+
rpcSubscriptions: _solana_kit.RpcSubscriptions<_solana_kit.SolanaRpcSubscriptionsApi>;
|
|
129
|
+
airdrop: (address: _solana_kit.Address, amount: _solana_kit.Lamports, abortSignal?: AbortSignal) => Promise<_solana_kit.Signature | undefined>;
|
|
130
|
+
}>;
|
|
131
|
+
type SolanaClient = ReturnType<typeof createSolanaClient>;
|
|
132
|
+
|
|
133
|
+
export { createSolanaClient as n };
|
|
134
|
+
export type { ConfirmTransactionOptions as C, SendTransactionOptions as S, TransactionConfirmation as T, SolanaChain as a, SolanaClient as b, SolanaCluster as c, SolanaConfig as d, SolanaContext as e, SolanaSignInAccount as f, SolanaSignInInput as g, SolanaSignInResult as h, SolanaSignMessageResult as i, SolanaTransaction as j, SolanaWallet as k, SolanaWalletInfo as l, TransactionStatus as m };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StandardEvents, StandardDisconnect, StandardConnect } from '@wallet-standard/features';
|
|
2
|
-
import {
|
|
2
|
+
import { SolanaSignTransaction, SolanaSignIn, SolanaSignAndSendTransaction, SolanaSignMessage } from '@solana/wallet-standard-features';
|
|
3
3
|
import bs58 from 'bs58';
|
|
4
4
|
import { getWallets } from '@wallet-standard/app';
|
|
5
5
|
|
|
@@ -16,14 +16,21 @@ function getSolanaChain(cluster) {
|
|
|
16
16
|
return `solana:${cluster}`;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
function hasVersionedFeature(wallet, feature) {
|
|
20
|
+
const value = wallet.features[feature];
|
|
21
|
+
return typeof value === "object" && value !== null && typeof value.version === "string";
|
|
22
|
+
}
|
|
19
23
|
function hasSignTransaction(wallet) {
|
|
20
|
-
return SolanaSignTransaction
|
|
24
|
+
return hasVersionedFeature(wallet, SolanaSignTransaction);
|
|
25
|
+
}
|
|
26
|
+
function hasSignIn(wallet) {
|
|
27
|
+
return hasVersionedFeature(wallet, SolanaSignIn);
|
|
21
28
|
}
|
|
22
29
|
function hasSignAndSendTransaction(wallet) {
|
|
23
|
-
return SolanaSignAndSendTransaction
|
|
30
|
+
return hasVersionedFeature(wallet, SolanaSignAndSendTransaction);
|
|
24
31
|
}
|
|
25
32
|
function hasSignMessage(wallet) {
|
|
26
|
-
return SolanaSignMessage
|
|
33
|
+
return hasVersionedFeature(wallet, SolanaSignMessage);
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
@@ -96,6 +103,13 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
|
96
103
|
options.onChange?.();
|
|
97
104
|
}
|
|
98
105
|
},
|
|
106
|
+
signIn: hasSignIn(wallet) ? async (input) => {
|
|
107
|
+
const [result] = await wallet.features[SolanaSignIn].signIn(...input ? [input] : []);
|
|
108
|
+
if (!result) {
|
|
109
|
+
throw new Error("Solana wallet did not return a sign-in result");
|
|
110
|
+
}
|
|
111
|
+
return toSolanaSignInResult(result);
|
|
112
|
+
} : void 0,
|
|
99
113
|
signMessage: hasSignMessage(wallet) ? async (message) => {
|
|
100
114
|
const activeAccount = getActiveAccount(account);
|
|
101
115
|
const [result] = await wallet.features[SolanaSignMessage].signMessage({
|
|
@@ -140,6 +154,12 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
|
140
154
|
return result.signedTransaction;
|
|
141
155
|
});
|
|
142
156
|
} : void 0,
|
|
157
|
+
signTransactions: hasSignTransaction(wallet) ? async (transactions) => signAllThroughFeature(
|
|
158
|
+
wallet,
|
|
159
|
+
() => getActiveAccount(account),
|
|
160
|
+
transactions,
|
|
161
|
+
options.chain
|
|
162
|
+
) : void 0,
|
|
143
163
|
signAndSendTransaction: hasSignAndSendTransaction(wallet) ? async (transaction, sendOptions) => {
|
|
144
164
|
const activeAccount = getActiveAccount(account);
|
|
145
165
|
const [result] = await wallet.features[SolanaSignAndSendTransaction].signAndSendTransaction({
|
|
@@ -152,9 +172,66 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
|
152
172
|
throw new Error("Solana wallet did not return a transaction signature");
|
|
153
173
|
}
|
|
154
174
|
return { signature: bs58.encode(result.signature) };
|
|
175
|
+
} : void 0,
|
|
176
|
+
signAndSendTransactions: hasSignAndSendTransaction(wallet) ? async (transactions, sendOptions) => {
|
|
177
|
+
const activeAccount = getActiveAccount(account);
|
|
178
|
+
const results = await wallet.features[SolanaSignAndSendTransaction].signAndSendTransaction(
|
|
179
|
+
...transactions.map((transaction) => ({
|
|
180
|
+
account: activeAccount,
|
|
181
|
+
transaction,
|
|
182
|
+
chain: options.chain ?? getSolanaAccountChain(activeAccount),
|
|
183
|
+
options: sendOptions
|
|
184
|
+
}))
|
|
185
|
+
);
|
|
186
|
+
if (results.length !== transactions.length) {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`Solana wallet returned ${results.length} signatures for ${transactions.length} requested transactions`
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
return results.map((result) => {
|
|
192
|
+
if (!result) {
|
|
193
|
+
throw new Error("Solana wallet did not return a transaction signature");
|
|
194
|
+
}
|
|
195
|
+
return bs58.encode(result.signature);
|
|
196
|
+
});
|
|
155
197
|
} : void 0
|
|
156
198
|
};
|
|
157
199
|
}
|
|
200
|
+
async function signAllThroughFeature(wallet, getAccount, transactions, chain) {
|
|
201
|
+
const activeAccount = getAccount();
|
|
202
|
+
const results = await wallet.features[SolanaSignTransaction].signTransaction(
|
|
203
|
+
...transactions.map((transaction) => ({
|
|
204
|
+
account: activeAccount,
|
|
205
|
+
transaction,
|
|
206
|
+
chain
|
|
207
|
+
}))
|
|
208
|
+
);
|
|
209
|
+
if (results.length !== transactions.length) {
|
|
210
|
+
throw new Error(
|
|
211
|
+
`Solana wallet returned ${results.length} signed transactions for ${transactions.length} requested transactions`
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
return results.map((result) => {
|
|
215
|
+
if (!result) {
|
|
216
|
+
throw new Error("Solana wallet did not return a signed transaction");
|
|
217
|
+
}
|
|
218
|
+
return result.signedTransaction;
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function toSolanaSignInResult(result) {
|
|
222
|
+
return {
|
|
223
|
+
account: {
|
|
224
|
+
address: result.account.address,
|
|
225
|
+
publicKey: Uint8Array.from(result.account.publicKey),
|
|
226
|
+
chains: [...result.account.chains],
|
|
227
|
+
label: result.account.label,
|
|
228
|
+
icon: result.account.icon
|
|
229
|
+
},
|
|
230
|
+
signedMessage: result.signedMessage,
|
|
231
|
+
signature: result.signature,
|
|
232
|
+
signatureType: result.signatureType
|
|
233
|
+
};
|
|
234
|
+
}
|
|
158
235
|
function getSolanaAccount(accounts, chain) {
|
|
159
236
|
return accounts.find((account) => account.chains.some((accountChain) => accountChain === chain)) ?? accounts.find(
|
|
160
237
|
(account) => account.chains.some((accountChain) => SOLANA_CHAINS.includes(accountChain))
|
|
@@ -211,6 +288,7 @@ function createSolanaWalletInfo(wallet) {
|
|
|
211
288
|
capabilities: {
|
|
212
289
|
connect: true,
|
|
213
290
|
disconnect: true,
|
|
291
|
+
signIn: hasSignIn(wallet),
|
|
214
292
|
signMessage: hasSignMessage(wallet),
|
|
215
293
|
signTransaction: hasSignTransaction(wallet),
|
|
216
294
|
signAllTransactions: hasSignTransaction(wallet),
|
|
@@ -22,14 +22,21 @@ function getSolanaChain(cluster) {
|
|
|
22
22
|
return `solana:${cluster}`;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
function hasVersionedFeature(wallet, feature) {
|
|
26
|
+
const value = wallet.features[feature];
|
|
27
|
+
return typeof value === "object" && value !== null && typeof value.version === "string";
|
|
28
|
+
}
|
|
25
29
|
function hasSignTransaction(wallet) {
|
|
26
|
-
return walletStandardFeatures.SolanaSignTransaction
|
|
30
|
+
return hasVersionedFeature(wallet, walletStandardFeatures.SolanaSignTransaction);
|
|
31
|
+
}
|
|
32
|
+
function hasSignIn(wallet) {
|
|
33
|
+
return hasVersionedFeature(wallet, walletStandardFeatures.SolanaSignIn);
|
|
27
34
|
}
|
|
28
35
|
function hasSignAndSendTransaction(wallet) {
|
|
29
|
-
return walletStandardFeatures.SolanaSignAndSendTransaction
|
|
36
|
+
return hasVersionedFeature(wallet, walletStandardFeatures.SolanaSignAndSendTransaction);
|
|
30
37
|
}
|
|
31
38
|
function hasSignMessage(wallet) {
|
|
32
|
-
return walletStandardFeatures.SolanaSignMessage
|
|
39
|
+
return hasVersionedFeature(wallet, walletStandardFeatures.SolanaSignMessage);
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
@@ -102,6 +109,13 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
|
102
109
|
options.onChange?.();
|
|
103
110
|
}
|
|
104
111
|
},
|
|
112
|
+
signIn: hasSignIn(wallet) ? async (input) => {
|
|
113
|
+
const [result] = await wallet.features[walletStandardFeatures.SolanaSignIn].signIn(...input ? [input] : []);
|
|
114
|
+
if (!result) {
|
|
115
|
+
throw new Error("Solana wallet did not return a sign-in result");
|
|
116
|
+
}
|
|
117
|
+
return toSolanaSignInResult(result);
|
|
118
|
+
} : void 0,
|
|
105
119
|
signMessage: hasSignMessage(wallet) ? async (message) => {
|
|
106
120
|
const activeAccount = getActiveAccount(account);
|
|
107
121
|
const [result] = await wallet.features[walletStandardFeatures.SolanaSignMessage].signMessage({
|
|
@@ -146,6 +160,12 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
|
146
160
|
return result.signedTransaction;
|
|
147
161
|
});
|
|
148
162
|
} : void 0,
|
|
163
|
+
signTransactions: hasSignTransaction(wallet) ? async (transactions) => signAllThroughFeature(
|
|
164
|
+
wallet,
|
|
165
|
+
() => getActiveAccount(account),
|
|
166
|
+
transactions,
|
|
167
|
+
options.chain
|
|
168
|
+
) : void 0,
|
|
149
169
|
signAndSendTransaction: hasSignAndSendTransaction(wallet) ? async (transaction, sendOptions) => {
|
|
150
170
|
const activeAccount = getActiveAccount(account);
|
|
151
171
|
const [result] = await wallet.features[walletStandardFeatures.SolanaSignAndSendTransaction].signAndSendTransaction({
|
|
@@ -158,9 +178,66 @@ function adaptSolanaStandardWallet(walletInfo, options = {}) {
|
|
|
158
178
|
throw new Error("Solana wallet did not return a transaction signature");
|
|
159
179
|
}
|
|
160
180
|
return { signature: bs58__default.encode(result.signature) };
|
|
181
|
+
} : void 0,
|
|
182
|
+
signAndSendTransactions: hasSignAndSendTransaction(wallet) ? async (transactions, sendOptions) => {
|
|
183
|
+
const activeAccount = getActiveAccount(account);
|
|
184
|
+
const results = await wallet.features[walletStandardFeatures.SolanaSignAndSendTransaction].signAndSendTransaction(
|
|
185
|
+
...transactions.map((transaction) => ({
|
|
186
|
+
account: activeAccount,
|
|
187
|
+
transaction,
|
|
188
|
+
chain: options.chain ?? getSolanaAccountChain(activeAccount),
|
|
189
|
+
options: sendOptions
|
|
190
|
+
}))
|
|
191
|
+
);
|
|
192
|
+
if (results.length !== transactions.length) {
|
|
193
|
+
throw new Error(
|
|
194
|
+
`Solana wallet returned ${results.length} signatures for ${transactions.length} requested transactions`
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
return results.map((result) => {
|
|
198
|
+
if (!result) {
|
|
199
|
+
throw new Error("Solana wallet did not return a transaction signature");
|
|
200
|
+
}
|
|
201
|
+
return bs58__default.encode(result.signature);
|
|
202
|
+
});
|
|
161
203
|
} : void 0
|
|
162
204
|
};
|
|
163
205
|
}
|
|
206
|
+
async function signAllThroughFeature(wallet, getAccount, transactions, chain) {
|
|
207
|
+
const activeAccount = getAccount();
|
|
208
|
+
const results = await wallet.features[walletStandardFeatures.SolanaSignTransaction].signTransaction(
|
|
209
|
+
...transactions.map((transaction) => ({
|
|
210
|
+
account: activeAccount,
|
|
211
|
+
transaction,
|
|
212
|
+
chain
|
|
213
|
+
}))
|
|
214
|
+
);
|
|
215
|
+
if (results.length !== transactions.length) {
|
|
216
|
+
throw new Error(
|
|
217
|
+
`Solana wallet returned ${results.length} signed transactions for ${transactions.length} requested transactions`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
return results.map((result) => {
|
|
221
|
+
if (!result) {
|
|
222
|
+
throw new Error("Solana wallet did not return a signed transaction");
|
|
223
|
+
}
|
|
224
|
+
return result.signedTransaction;
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function toSolanaSignInResult(result) {
|
|
228
|
+
return {
|
|
229
|
+
account: {
|
|
230
|
+
address: result.account.address,
|
|
231
|
+
publicKey: Uint8Array.from(result.account.publicKey),
|
|
232
|
+
chains: [...result.account.chains],
|
|
233
|
+
label: result.account.label,
|
|
234
|
+
icon: result.account.icon
|
|
235
|
+
},
|
|
236
|
+
signedMessage: result.signedMessage,
|
|
237
|
+
signature: result.signature,
|
|
238
|
+
signatureType: result.signatureType
|
|
239
|
+
};
|
|
240
|
+
}
|
|
164
241
|
function getSolanaAccount(accounts, chain) {
|
|
165
242
|
return accounts.find((account) => account.chains.some((accountChain) => accountChain === chain)) ?? accounts.find(
|
|
166
243
|
(account) => account.chains.some((accountChain) => SOLANA_CHAINS.includes(accountChain))
|
|
@@ -217,6 +294,7 @@ function createSolanaWalletInfo(wallet) {
|
|
|
217
294
|
capabilities: {
|
|
218
295
|
connect: true,
|
|
219
296
|
disconnect: true,
|
|
297
|
+
signIn: hasSignIn(wallet),
|
|
220
298
|
signMessage: hasSignMessage(wallet),
|
|
221
299
|
signTransaction: hasSignTransaction(wallet),
|
|
222
300
|
signAllTransactions: hasSignTransaction(wallet),
|
package/dist/token-accounts.d.ts
CHANGED
package/dist/transaction.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Signature } from '@solana/kit';
|
|
2
|
-
import { b as SolanaClient, C as ConfirmTransactionOptions, T as TransactionConfirmation,
|
|
2
|
+
import { b as SolanaClient, C as ConfirmTransactionOptions, T as TransactionConfirmation, k as SolanaWallet, j as SolanaTransaction, S as SendTransactionOptions } from './shared/core.Bk0PszDR.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Sign and send a transaction through a connected wallet.
|
package/dist/transaction.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Signature } from '@solana/kit';
|
|
2
|
-
import { b as SolanaClient, C as ConfirmTransactionOptions, T as TransactionConfirmation,
|
|
2
|
+
import { b as SolanaClient, C as ConfirmTransactionOptions, T as TransactionConfirmation, k as SolanaWallet, j as SolanaTransaction, S as SendTransactionOptions } from './shared/core.Bk0PszDR.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Sign and send a transaction through a connected wallet.
|
package/dist/transaction.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Signature } from '@solana/kit';
|
|
2
|
-
import { b as SolanaClient, C as ConfirmTransactionOptions, T as TransactionConfirmation,
|
|
2
|
+
import { b as SolanaClient, C as ConfirmTransactionOptions, T as TransactionConfirmation, k as SolanaWallet, j as SolanaTransaction, S as SendTransactionOptions } from './shared/core.Bk0PszDR.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Sign and send a transaction through a connected wallet.
|
package/dist/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
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
|
|
2
|
+
export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, 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 } from './shared/core.Bk0PszDR.cjs';
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
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
|
|
2
|
+
export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, 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 } from './shared/core.Bk0PszDR.mjs';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
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
|
|
2
|
+
export { C as ConfirmTransactionOptions, S as SendTransactionOptions, a as SolanaChain, 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 } from './shared/core.Bk0PszDR.js';
|
package/dist/wallet-standard.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WalletAccount, Wallet } from '@wallet-standard/base';
|
|
2
|
-
import { a as SolanaChain,
|
|
2
|
+
import { a as SolanaChain, l as SolanaWalletInfo, k as SolanaWallet, c as SolanaCluster } from './shared/core.Bk0PszDR.cjs';
|
|
3
3
|
import '@solana/kit';
|
|
4
4
|
|
|
5
5
|
interface AdaptSolanaWalletOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WalletAccount, Wallet } from '@wallet-standard/base';
|
|
2
|
-
import { a as SolanaChain,
|
|
2
|
+
import { a as SolanaChain, l as SolanaWalletInfo, k as SolanaWallet, c as SolanaCluster } from './shared/core.Bk0PszDR.mjs';
|
|
3
3
|
import '@solana/kit';
|
|
4
4
|
|
|
5
5
|
interface AdaptSolanaWalletOptions {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WalletAccount, Wallet } from '@wallet-standard/base';
|
|
2
|
-
import { a as SolanaChain,
|
|
2
|
+
import { a as SolanaChain, l as SolanaWalletInfo, k as SolanaWallet, c as SolanaCluster } from './shared/core.Bk0PszDR.js';
|
|
3
3
|
import '@solana/kit';
|
|
4
4
|
|
|
5
5
|
interface AdaptSolanaWalletOptions {
|
package/dist/wallet-standard.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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.
|
|
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.DEcQDbtz.mjs';
|
|
2
2
|
import '@wallet-standard/features';
|
|
3
3
|
import '@solana/wallet-standard-features';
|
|
4
4
|
import 'bs58';
|
package/dist/wallet.cjs
CHANGED
|
@@ -39,10 +39,43 @@ function assertWalletCanSignMessage(wallet) {
|
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
function assertWalletCanSignIn(wallet) {
|
|
43
|
+
assertWalletConnected(wallet);
|
|
44
|
+
if (!wallet.signIn) {
|
|
45
|
+
throw new SolanaWalletError(
|
|
46
|
+
"WALLET_FEATURE_UNSUPPORTED",
|
|
47
|
+
"Solana wallet does not support signIn (Sign In With Solana)",
|
|
48
|
+
{ feature: "signIn" }
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function assertWalletCanSignTransactions(wallet) {
|
|
53
|
+
assertWalletConnected(wallet);
|
|
54
|
+
if (!wallet.signTransactions && !wallet.signAllTransactions) {
|
|
55
|
+
throw new SolanaWalletError(
|
|
56
|
+
"WALLET_FEATURE_UNSUPPORTED",
|
|
57
|
+
"Solana wallet does not support signTransactions",
|
|
58
|
+
{ feature: "signTransactions" }
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function assertWalletCanSignAndSendTransactions(wallet) {
|
|
63
|
+
assertWalletConnected(wallet);
|
|
64
|
+
if (!wallet.signAndSendTransactions && !wallet.signAndSendTransaction) {
|
|
65
|
+
throw new SolanaWalletError(
|
|
66
|
+
"WALLET_FEATURE_UNSUPPORTED",
|
|
67
|
+
"Solana wallet does not support signAndSendTransactions",
|
|
68
|
+
{ feature: "signAndSendTransactions" }
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
42
72
|
|
|
43
73
|
exports.SolanaWalletError = SolanaWalletError;
|
|
44
74
|
exports.assertWalletCanSign = assertWalletCanSign;
|
|
75
|
+
exports.assertWalletCanSignAndSendTransactions = assertWalletCanSignAndSendTransactions;
|
|
76
|
+
exports.assertWalletCanSignIn = assertWalletCanSignIn;
|
|
45
77
|
exports.assertWalletCanSignMessage = assertWalletCanSignMessage;
|
|
78
|
+
exports.assertWalletCanSignTransactions = assertWalletCanSignTransactions;
|
|
46
79
|
exports.assertWalletConnected = assertWalletConnected;
|
|
47
80
|
exports.createNoWalletSelectedError = createNoWalletSelectedError;
|
|
48
81
|
exports.isWalletConnected = isWalletConnected;
|
package/dist/wallet.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as SolanaWallet } from './shared/core.Bk0PszDR.cjs';
|
|
2
2
|
import { SolanaError } from './errors.cjs';
|
|
3
3
|
import '@solana/kit';
|
|
4
4
|
|
|
@@ -16,6 +16,9 @@ declare function assertWalletConnected(wallet: SolanaWallet | null | undefined):
|
|
|
16
16
|
};
|
|
17
17
|
declare function assertWalletCanSign(wallet: SolanaWallet | null | undefined): asserts wallet is SolanaWallet & Required<Pick<SolanaWallet, "signTransaction">>;
|
|
18
18
|
declare function assertWalletCanSignMessage(wallet: SolanaWallet | null | undefined): asserts wallet is SolanaWallet & Required<Pick<SolanaWallet, "signMessage">>;
|
|
19
|
+
declare function assertWalletCanSignIn(wallet: SolanaWallet | null | undefined): asserts wallet is SolanaWallet & Required<Pick<SolanaWallet, "signIn">>;
|
|
20
|
+
declare function assertWalletCanSignTransactions(wallet: SolanaWallet | null | undefined): asserts wallet is SolanaWallet & Required<Pick<SolanaWallet, "signTransactions">>;
|
|
21
|
+
declare function assertWalletCanSignAndSendTransactions(wallet: SolanaWallet | null | undefined): asserts wallet is SolanaWallet & Required<Pick<SolanaWallet, "signAndSendTransactions">>;
|
|
19
22
|
|
|
20
|
-
export { SolanaWalletError, assertWalletCanSign, assertWalletCanSignMessage, assertWalletConnected, createNoWalletSelectedError, isWalletConnected };
|
|
23
|
+
export { SolanaWalletError, assertWalletCanSign, assertWalletCanSignAndSendTransactions, assertWalletCanSignIn, assertWalletCanSignMessage, assertWalletCanSignTransactions, assertWalletConnected, createNoWalletSelectedError, isWalletConnected };
|
|
21
24
|
export type { SolanaWalletErrorCode };
|