@vue-solana/core 2.6.1 → 3.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.
- package/README.md +6 -4
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +4 -3
- package/dist/ios-wallet.mjs +1 -1
- package/dist/kit.d.mts +1 -1
- package/dist/kit.d.ts +1 -1
- package/dist/kit.mjs +4 -4
- package/dist/shared/{core.TqudP0hB.mjs → core.DaUlAmcN.mjs} +15 -22
- package/dist/shared/{core.CDVW-ApZ.mjs → core.DuQGQqnc.mjs} +29 -26
- package/dist/timeout.mjs +3 -0
- package/dist/wallet-standard.mjs +1 -1
- package/dist/wallet.mjs +26 -39
- package/package.json +18 -35
- package/dist/action.cjs +0 -14
- package/dist/action.d.cts +0 -28
- package/dist/address.cjs +0 -33
- package/dist/address.d.cts +0 -16
- package/dist/buffer-polyfill.cjs +0 -12
- package/dist/buffer-polyfill.d.cts +0 -7
- package/dist/clusters.cjs +0 -37
- package/dist/clusters.d.cts +0 -10
- package/dist/errors.cjs +0 -50
- package/dist/errors.d.cts +0 -17
- package/dist/index.cjs +0 -94
- package/dist/index.d.cts +0 -19
- package/dist/ios-wallet.cjs +0 -17
- package/dist/ios-wallet.d.cts +0 -62
- package/dist/kit.cjs +0 -88
- package/dist/kit.d.cts +0 -3
- package/dist/mobile-wallet.cjs +0 -69
- package/dist/mobile-wallet.d.cts +0 -20
- package/dist/rpc.cjs +0 -20
- package/dist/rpc.d.cts +0 -7
- package/dist/shared/core.C9vxHRXl.d.cts +0 -193
- package/dist/shared/core.CasnoavM.cjs +0 -323
- package/dist/shared/core.eIBHqmLq.cjs +0 -598
- package/dist/timeout.cjs +0 -32
- package/dist/timeout.d.cts +0 -4
- package/dist/token-accounts.cjs +0 -72
- package/dist/token-accounts.d.cts +0 -36
- package/dist/transaction.cjs +0 -81
- package/dist/transaction.d.cts +0 -18
- package/dist/types.cjs +0 -2
- package/dist/types.d.cts +0 -3
- package/dist/wallet-standard.cjs +0 -17
- package/dist/wallet-standard.d.cts +0 -22
- package/dist/wallet.cjs +0 -81
- package/dist/wallet.d.cts +0 -25
package/dist/clusters.cjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_CLUSTER = "devnet";
|
|
4
|
-
const CLUSTER_ENDPOINTS = {
|
|
5
|
-
mainnet: "https://api.mainnet.solana.com",
|
|
6
|
-
"mainnet-beta": "https://api.mainnet.solana.com",
|
|
7
|
-
testnet: "https://api.testnet.solana.com",
|
|
8
|
-
devnet: "https://api.devnet.solana.com",
|
|
9
|
-
localnet: "http://127.0.0.1:8899"
|
|
10
|
-
};
|
|
11
|
-
const CLUSTER_WEBSOCKET_ENDPOINTS = {
|
|
12
|
-
mainnet: "wss://api.mainnet.solana.com",
|
|
13
|
-
"mainnet-beta": "wss://api.mainnet.solana.com",
|
|
14
|
-
testnet: "wss://api.testnet.solana.com",
|
|
15
|
-
devnet: "wss://api.devnet.solana.com",
|
|
16
|
-
localnet: "ws://127.0.0.1:8900"
|
|
17
|
-
};
|
|
18
|
-
function getClusterEndpoint(cluster = DEFAULT_CLUSTER) {
|
|
19
|
-
return CLUSTER_ENDPOINTS[cluster];
|
|
20
|
-
}
|
|
21
|
-
function getClusterWebSocketEndpoint(cluster = DEFAULT_CLUSTER) {
|
|
22
|
-
return CLUSTER_WEBSOCKET_ENDPOINTS[cluster];
|
|
23
|
-
}
|
|
24
|
-
function getWebSocketEndpoint(endpoint) {
|
|
25
|
-
const url = new URL(endpoint);
|
|
26
|
-
if (url.protocol === "https:") {
|
|
27
|
-
url.protocol = "wss:";
|
|
28
|
-
} else if (url.protocol === "http:") {
|
|
29
|
-
url.protocol = "ws:";
|
|
30
|
-
}
|
|
31
|
-
return url.toString();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
exports.DEFAULT_CLUSTER = DEFAULT_CLUSTER;
|
|
35
|
-
exports.getClusterEndpoint = getClusterEndpoint;
|
|
36
|
-
exports.getClusterWebSocketEndpoint = getClusterWebSocketEndpoint;
|
|
37
|
-
exports.getWebSocketEndpoint = getWebSocketEndpoint;
|
package/dist/clusters.d.cts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { c as SolanaCluster } from './shared/core.C9vxHRXl.cjs';
|
|
2
|
-
import '@solana/kit-plugin-rpc';
|
|
3
|
-
import '@solana/kit';
|
|
4
|
-
|
|
5
|
-
declare const DEFAULT_CLUSTER: SolanaCluster;
|
|
6
|
-
declare function getClusterEndpoint(cluster?: SolanaCluster): string;
|
|
7
|
-
declare function getClusterWebSocketEndpoint(cluster?: SolanaCluster): string;
|
|
8
|
-
declare function getWebSocketEndpoint(endpoint: string): string;
|
|
9
|
-
|
|
10
|
-
export { DEFAULT_CLUSTER, getClusterEndpoint, getClusterWebSocketEndpoint, getWebSocketEndpoint };
|
package/dist/errors.cjs
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
class SolanaError extends Error {
|
|
4
|
-
constructor(code, message, options = {}) {
|
|
5
|
-
super(message);
|
|
6
|
-
this.code = code;
|
|
7
|
-
this.name = "SolanaError";
|
|
8
|
-
this.cause = options.cause;
|
|
9
|
-
this.feature = options.feature;
|
|
10
|
-
}
|
|
11
|
-
cause;
|
|
12
|
-
feature;
|
|
13
|
-
}
|
|
14
|
-
function createSolanaError(code, message, options) {
|
|
15
|
-
return new SolanaError(code, message, options);
|
|
16
|
-
}
|
|
17
|
-
function isSolanaError(error) {
|
|
18
|
-
return error instanceof SolanaError;
|
|
19
|
-
}
|
|
20
|
-
function normalizeSolanaError(cause, fallbackCode, fallbackMessage, options = {}) {
|
|
21
|
-
if (isSolanaError(cause)) {
|
|
22
|
-
return cause;
|
|
23
|
-
}
|
|
24
|
-
const code = isUserRejectedError(cause) ? "USER_REJECTED" : fallbackCode;
|
|
25
|
-
const message = fallbackMessage ?? getErrorMessage(cause);
|
|
26
|
-
return createSolanaError(code, message, { ...options, cause });
|
|
27
|
-
}
|
|
28
|
-
function getErrorMessage(cause) {
|
|
29
|
-
if (cause instanceof Error) {
|
|
30
|
-
return cause.message;
|
|
31
|
-
}
|
|
32
|
-
return typeof cause === "string" ? cause : "An unknown Solana error occurred";
|
|
33
|
-
}
|
|
34
|
-
function isUserRejectedError(cause) {
|
|
35
|
-
if (hasErrorCode(cause) && (cause.code === 4001 || cause.code === "4001")) {
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
const message = getErrorMessage(cause).toLowerCase();
|
|
39
|
-
return message.includes("user rejected") || message.includes("user denied");
|
|
40
|
-
}
|
|
41
|
-
function hasErrorCode(cause) {
|
|
42
|
-
return Boolean(
|
|
43
|
-
cause && typeof cause === "object" && "code" in cause && (typeof cause.code === "number" || typeof cause.code === "string")
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
exports.SolanaError = SolanaError;
|
|
48
|
-
exports.createSolanaError = createSolanaError;
|
|
49
|
-
exports.isSolanaError = isSolanaError;
|
|
50
|
-
exports.normalizeSolanaError = normalizeSolanaError;
|
package/dist/errors.d.cts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
type SolanaErrorCode = "NO_WALLET_SELECTED" | "WALLET_NOT_CONNECTED" | "WALLET_FEATURE_UNSUPPORTED" | "USER_REJECTED" | "INVALID_ADDRESS" | "TRANSACTION_TIMEOUT" | "RPC_FAILURE" | "STORAGE_FAILURE";
|
|
2
|
-
interface SolanaErrorOptions {
|
|
3
|
-
cause?: unknown;
|
|
4
|
-
feature?: string;
|
|
5
|
-
}
|
|
6
|
-
declare class SolanaError extends Error {
|
|
7
|
-
readonly code: SolanaErrorCode;
|
|
8
|
-
readonly cause?: unknown;
|
|
9
|
-
readonly feature?: string;
|
|
10
|
-
constructor(code: SolanaErrorCode, message: string, options?: SolanaErrorOptions);
|
|
11
|
-
}
|
|
12
|
-
declare function createSolanaError(code: SolanaErrorCode, message: string, options?: SolanaErrorOptions): SolanaError;
|
|
13
|
-
declare function isSolanaError(error: unknown): error is SolanaError;
|
|
14
|
-
declare function normalizeSolanaError(cause: unknown, fallbackCode: SolanaErrorCode, fallbackMessage?: string, options?: Omit<SolanaErrorOptions, "cause">): SolanaError;
|
|
15
|
-
|
|
16
|
-
export { SolanaError, createSolanaError, isSolanaError, normalizeSolanaError };
|
|
17
|
-
export type { SolanaErrorCode, SolanaErrorOptions };
|
package/dist/index.cjs
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const action = require('./action.cjs');
|
|
4
|
-
const clusters = require('./clusters.cjs');
|
|
5
|
-
const address = require('./address.cjs');
|
|
6
|
-
const bufferPolyfill = require('./buffer-polyfill.cjs');
|
|
7
|
-
const errors = require('./errors.cjs');
|
|
8
|
-
const kit$1 = require('./kit.cjs');
|
|
9
|
-
const mobileWallet = require('./mobile-wallet.cjs');
|
|
10
|
-
const rpc = require('./rpc.cjs');
|
|
11
|
-
const tokenAccounts = require('./token-accounts.cjs');
|
|
12
|
-
const transaction = require('./transaction.cjs');
|
|
13
|
-
const timeout = require('./timeout.cjs');
|
|
14
|
-
const wallet = require('./wallet.cjs');
|
|
15
|
-
const kit = require('@solana/kit');
|
|
16
|
-
const _ = require('buffer/');
|
|
17
|
-
const discovery = require('./shared/core.CasnoavM.cjs');
|
|
18
|
-
const adapter = require('./shared/core.eIBHqmLq.cjs');
|
|
19
|
-
require('@solana/kit-plugin-rpc');
|
|
20
|
-
require('@solana-mobile/wallet-standard-mobile');
|
|
21
|
-
require('@wallet-standard/features');
|
|
22
|
-
require('@solana/wallet-standard-features');
|
|
23
|
-
require('bs58');
|
|
24
|
-
require('@wallet-standard/app');
|
|
25
|
-
require('tweetnacl');
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exports.createSolanaActionStore = action.createSolanaActionStore;
|
|
30
|
-
exports.isSolanaActionAborted = action.isSolanaActionAborted;
|
|
31
|
-
exports.DEFAULT_CLUSTER = clusters.DEFAULT_CLUSTER;
|
|
32
|
-
exports.getClusterEndpoint = clusters.getClusterEndpoint;
|
|
33
|
-
exports.getClusterWebSocketEndpoint = clusters.getClusterWebSocketEndpoint;
|
|
34
|
-
exports.getWebSocketEndpoint = clusters.getWebSocketEndpoint;
|
|
35
|
-
exports.parseAddress = address.parseAddress;
|
|
36
|
-
exports.installSolanaBufferPolyfill = bufferPolyfill.installSolanaBufferPolyfill;
|
|
37
|
-
exports.SolanaError = errors.SolanaError;
|
|
38
|
-
exports.createSolanaError = errors.createSolanaError;
|
|
39
|
-
exports.isSolanaError = errors.isSolanaError;
|
|
40
|
-
exports.normalizeSolanaError = errors.normalizeSolanaError;
|
|
41
|
-
exports.createSolanaClient = kit$1.createSolanaClient;
|
|
42
|
-
exports.getDefaultMobileWalletAppIdentity = mobileWallet.getDefaultMobileWalletAppIdentity;
|
|
43
|
-
exports.isSolanaMobileWalletSupported = mobileWallet.isSolanaMobileWalletSupported;
|
|
44
|
-
exports.registerSolanaMobileWallet = mobileWallet.registerSolanaMobileWallet;
|
|
45
|
-
exports.createSolanaContext = rpc.createSolanaContext;
|
|
46
|
-
exports.getTokenAccount = tokenAccounts.getTokenAccount;
|
|
47
|
-
exports.getTokenAccountsByOwner = tokenAccounts.getTokenAccountsByOwner;
|
|
48
|
-
exports.getTokenBalance = tokenAccounts.getTokenBalance;
|
|
49
|
-
exports.confirmTransactionSignature = transaction.confirmTransactionSignature;
|
|
50
|
-
exports.signAndSendTransaction = transaction.signAndSendTransaction;
|
|
51
|
-
exports.withSolanaTimeout = timeout.withSolanaTimeout;
|
|
52
|
-
exports.withTimeout = timeout.withTimeout;
|
|
53
|
-
exports.SolanaWalletError = wallet.SolanaWalletError;
|
|
54
|
-
exports.assertWalletCanSign = wallet.assertWalletCanSign;
|
|
55
|
-
exports.assertWalletCanSignAndSendTransactions = wallet.assertWalletCanSignAndSendTransactions;
|
|
56
|
-
exports.assertWalletCanSignIn = wallet.assertWalletCanSignIn;
|
|
57
|
-
exports.assertWalletCanSignMessage = wallet.assertWalletCanSignMessage;
|
|
58
|
-
exports.assertWalletCanSignTransactions = wallet.assertWalletCanSignTransactions;
|
|
59
|
-
exports.assertWalletConnected = wallet.assertWalletConnected;
|
|
60
|
-
exports.createNoWalletSelectedError = wallet.createNoWalletSelectedError;
|
|
61
|
-
exports.isWalletConnected = wallet.isWalletConnected;
|
|
62
|
-
exports.AccountRole = kit.AccountRole;
|
|
63
|
-
exports.address = kit.address;
|
|
64
|
-
exports.appendTransactionMessageInstruction = kit.appendTransactionMessageInstruction;
|
|
65
|
-
exports.compileTransaction = kit.compileTransaction;
|
|
66
|
-
exports.createReactiveActionStore = kit.createReactiveActionStore;
|
|
67
|
-
exports.createReactiveStoreWithInitialValueAndSlotTracking = kit.createReactiveStoreWithInitialValueAndSlotTracking;
|
|
68
|
-
exports.createTransactionMessage = kit.createTransactionMessage;
|
|
69
|
-
exports.extendClient = kit.extendClient;
|
|
70
|
-
exports.generateKeyPairSigner = kit.generateKeyPairSigner;
|
|
71
|
-
exports.getAbortablePromise = kit.getAbortablePromise;
|
|
72
|
-
exports.getTransactionEncoder = kit.getTransactionEncoder;
|
|
73
|
-
exports.isAbortError = kit.isAbortError;
|
|
74
|
-
exports.isAddress = kit.isAddress;
|
|
75
|
-
exports.lamports = kit.lamports;
|
|
76
|
-
exports.setTransactionMessageFeePayer = kit.setTransactionMessageFeePayer;
|
|
77
|
-
exports.setTransactionMessageLifetimeUsingBlockhash = kit.setTransactionMessageLifetimeUsingBlockhash;
|
|
78
|
-
exports.summarizeTransactionPlanResult = kit.summarizeTransactionPlanResult;
|
|
79
|
-
exports.Buffer = _.Buffer;
|
|
80
|
-
exports.SOLANA_CHAINS = discovery.SOLANA_CHAINS;
|
|
81
|
-
exports.SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME = discovery.SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME;
|
|
82
|
-
exports.adaptSolanaStandardWallet = discovery.adaptSolanaStandardWallet;
|
|
83
|
-
exports.getRegisteredSolanaWallets = discovery.getRegisteredSolanaWallets;
|
|
84
|
-
exports.getSolanaChain = discovery.getSolanaChain;
|
|
85
|
-
exports.isSolanaStandardWallet = discovery.isSolanaStandardWallet;
|
|
86
|
-
exports.subscribeSolanaWallets = discovery.subscribeSolanaWallets;
|
|
87
|
-
exports.adaptSolanaIosWallet = adapter.adaptSolanaIosWallet;
|
|
88
|
-
exports.getDefaultIosWalletAppIdentity = adapter.getDefaultIosWalletAppIdentity;
|
|
89
|
-
exports.getDefaultIosWalletRedirectUrl = adapter.getDefaultIosWalletRedirectUrl;
|
|
90
|
-
exports.getSolanaIosWallets = adapter.getSolanaIosWallets;
|
|
91
|
-
exports.handleSolanaIosWalletCallback = adapter.handleSolanaIosWalletCallback;
|
|
92
|
-
exports.isIosBrowser = adapter.isIosBrowser;
|
|
93
|
-
exports.isSolanaIosBrowserWalletSupported = adapter.isSolanaIosBrowserWalletSupported;
|
|
94
|
-
exports.isSolanaIosWalletInfo = adapter.isSolanaIosWalletInfo;
|
package/dist/index.d.cts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/// <reference path="../types/buffer.d.ts" />
|
|
2
|
-
export { SolanaActionState, SolanaActionStore, createSolanaActionStore, isSolanaActionAborted } from './action.cjs';
|
|
3
|
-
export { DEFAULT_CLUSTER, getClusterEndpoint, getClusterWebSocketEndpoint, getWebSocketEndpoint } from './clusters.cjs';
|
|
4
|
-
export { AddressInput, MaybeAddressInput, parseAddress } from './address.cjs';
|
|
5
|
-
export { installSolanaBufferPolyfill } from './buffer-polyfill.cjs';
|
|
6
|
-
export { SolanaError, SolanaErrorCode, SolanaErrorOptions, createSolanaError, isSolanaError, normalizeSolanaError } from './errors.cjs';
|
|
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.cjs';
|
|
8
|
-
export { RegisterSolanaMobileWalletOptions, SolanaMobileWalletAppIdentity, getDefaultMobileWalletAppIdentity, isSolanaMobileWalletSupported, registerSolanaMobileWallet } from './mobile-wallet.cjs';
|
|
9
|
-
export { createSolanaContext } from './rpc.cjs';
|
|
10
|
-
export { TokenAccountInfo, TokenAccountsByOwnerOptions, TokenBalanceResult, getTokenAccount, getTokenAccountsByOwner, getTokenBalance } from './token-accounts.cjs';
|
|
11
|
-
export { confirmTransactionSignature, signAndSendTransaction } from './transaction.cjs';
|
|
12
|
-
export { withSolanaTimeout, withTimeout } from './timeout.cjs';
|
|
13
|
-
export { SolanaWalletError, SolanaWalletErrorCode, assertWalletCanSign, assertWalletCanSignAndSendTransactions, assertWalletCanSignIn, assertWalletCanSignMessage, assertWalletCanSignTransactions, assertWalletConnected, createNoWalletSelectedError, isWalletConnected } from './wallet.cjs';
|
|
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';
|
|
15
|
-
export { AdaptSolanaIosWalletOptions, GetSolanaIosWalletsOptions, IosWalletCallbackResult, IosWalletInfo, IosWalletMethod, SolanaIosWalletAppIdentity, adaptSolanaIosWallet, getDefaultIosWalletAppIdentity, getDefaultIosWalletRedirectUrl, getSolanaIosWallets, handleSolanaIosWalletCallback, isIosBrowser, isSolanaIosBrowserWalletSupported, isSolanaIosWalletInfo } from './ios-wallet.cjs';
|
|
16
|
-
export { AdaptSolanaWalletOptions, SOLANA_CHAINS, SOLANA_MOBILE_WALLET_ADAPTER_WALLET_NAME, adaptSolanaStandardWallet, getRegisteredSolanaWallets, getSolanaChain, isSolanaStandardWallet, subscribeSolanaWallets } from './wallet-standard.cjs';
|
|
17
|
-
export { Buffer } from 'buffer/';
|
|
18
|
-
import '@solana/kit-plugin-rpc';
|
|
19
|
-
import '@wallet-standard/base';
|
package/dist/ios-wallet.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const adapter = require('./shared/core.eIBHqmLq.cjs');
|
|
4
|
-
require('@solana/kit');
|
|
5
|
-
require('bs58');
|
|
6
|
-
require('tweetnacl');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.adaptSolanaIosWallet = adapter.adaptSolanaIosWallet;
|
|
11
|
-
exports.getDefaultIosWalletAppIdentity = adapter.getDefaultIosWalletAppIdentity;
|
|
12
|
-
exports.getDefaultIosWalletRedirectUrl = adapter.getDefaultIosWalletRedirectUrl;
|
|
13
|
-
exports.getSolanaIosWallets = adapter.getSolanaIosWallets;
|
|
14
|
-
exports.handleSolanaIosWalletCallback = adapter.handleSolanaIosWalletCallback;
|
|
15
|
-
exports.isIosBrowser = adapter.isIosBrowser;
|
|
16
|
-
exports.isSolanaIosBrowserWalletSupported = adapter.isSolanaIosBrowserWalletSupported;
|
|
17
|
-
exports.isSolanaIosWalletInfo = adapter.isSolanaIosWalletInfo;
|
package/dist/ios-wallet.d.cts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { a as SolanaChain, c as SolanaCluster, l as SolanaWalletInfo, k as SolanaWallet } from './shared/core.C9vxHRXl.cjs';
|
|
2
|
-
import '@solana/kit-plugin-rpc';
|
|
3
|
-
import '@solana/kit';
|
|
4
|
-
|
|
5
|
-
interface SolanaIosWalletAppIdentity {
|
|
6
|
-
name: string;
|
|
7
|
-
uri: string;
|
|
8
|
-
icon?: string;
|
|
9
|
-
}
|
|
10
|
-
interface GetSolanaIosWalletsOptions {
|
|
11
|
-
appIdentity?: SolanaIosWalletAppIdentity;
|
|
12
|
-
redirectUrl?: string;
|
|
13
|
-
chains?: readonly SolanaChain[];
|
|
14
|
-
cluster?: SolanaCluster;
|
|
15
|
-
}
|
|
16
|
-
interface AdaptSolanaIosWalletOptions {
|
|
17
|
-
appIdentity?: SolanaIosWalletAppIdentity;
|
|
18
|
-
redirectUrl?: string;
|
|
19
|
-
chain?: SolanaChain;
|
|
20
|
-
cluster?: SolanaCluster;
|
|
21
|
-
onChange?: () => void;
|
|
22
|
-
}
|
|
23
|
-
interface IosWalletDefinition {
|
|
24
|
-
id: string;
|
|
25
|
-
name: string;
|
|
26
|
-
icon: string;
|
|
27
|
-
appUrl: string;
|
|
28
|
-
installUrl: string;
|
|
29
|
-
encryptionPublicKeyParam: string;
|
|
30
|
-
connectUrl: string;
|
|
31
|
-
signTransactionUrl?: string;
|
|
32
|
-
signAllTransactionsUrl?: string;
|
|
33
|
-
signAndSendTransactionUrl?: string;
|
|
34
|
-
}
|
|
35
|
-
type IosWalletMethod = "connect" | "signTransaction" | "signAllTransactions" | "signAndSendTransaction";
|
|
36
|
-
type IosWalletCallbackResult = {
|
|
37
|
-
walletId: string;
|
|
38
|
-
method: IosWalletMethod;
|
|
39
|
-
publicKey?: string;
|
|
40
|
-
signature?: string;
|
|
41
|
-
transaction?: Uint8Array;
|
|
42
|
-
transactions?: Uint8Array[];
|
|
43
|
-
};
|
|
44
|
-
type IosWalletInfo = SolanaWalletInfo & {
|
|
45
|
-
wallet: IosWalletDefinition;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
declare function getSolanaIosWallets(options?: GetSolanaIosWalletsOptions): SolanaWalletInfo[];
|
|
49
|
-
declare function adaptSolanaIosWallet(walletInfo: SolanaWalletInfo, options?: AdaptSolanaIosWalletOptions): SolanaWallet;
|
|
50
|
-
declare function isSolanaIosWalletInfo(walletInfo: SolanaWalletInfo): walletInfo is IosWalletInfo;
|
|
51
|
-
|
|
52
|
-
declare function isSolanaIosBrowserWalletSupported(): boolean;
|
|
53
|
-
declare function isIosBrowser(): boolean;
|
|
54
|
-
declare function getDefaultIosWalletAppIdentity(): SolanaIosWalletAppIdentity;
|
|
55
|
-
declare function getDefaultIosWalletRedirectUrl(): string;
|
|
56
|
-
|
|
57
|
-
declare function handleSolanaIosWalletCallback(options?: {
|
|
58
|
-
clearUrl?: boolean;
|
|
59
|
-
}): IosWalletCallbackResult | null;
|
|
60
|
-
|
|
61
|
-
export { adaptSolanaIosWallet, getDefaultIosWalletAppIdentity, getDefaultIosWalletRedirectUrl, getSolanaIosWallets, handleSolanaIosWalletCallback, isIosBrowser, isSolanaIosBrowserWalletSupported, isSolanaIosWalletInfo };
|
|
62
|
-
export type { AdaptSolanaIosWalletOptions, GetSolanaIosWalletsOptions, IosWalletCallbackResult, IosWalletInfo, IosWalletMethod, SolanaIosWalletAppIdentity };
|
package/dist/kit.cjs
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const kit = require('@solana/kit');
|
|
4
|
-
const kitPluginRpc = require('@solana/kit-plugin-rpc');
|
|
5
|
-
const clusters = require('./clusters.cjs');
|
|
6
|
-
|
|
7
|
-
function buildSolanaClient(endpoint, wsEndpoint, payer) {
|
|
8
|
-
const client = kit.createClient().use(
|
|
9
|
-
(current) => kit.extendClient(current, payer ? { payer } : {})
|
|
10
|
-
);
|
|
11
|
-
return client.use(
|
|
12
|
-
kitPluginRpc.solanaRpc({
|
|
13
|
-
rpcUrl: endpoint,
|
|
14
|
-
rpcSubscriptionsUrl: wsEndpoint
|
|
15
|
-
})
|
|
16
|
-
).use(kitPluginRpc.rpcAirdrop());
|
|
17
|
-
}
|
|
18
|
-
function createSolanaClient(config = {}) {
|
|
19
|
-
const cluster = config.cluster ?? clusters.DEFAULT_CLUSTER;
|
|
20
|
-
const endpoint = config.endpoint ?? clusters.getClusterEndpoint(cluster);
|
|
21
|
-
const wsEndpoint = config.wsEndpoint ?? (config.endpoint ? clusters.getWebSocketEndpoint(endpoint) : clusters.getClusterWebSocketEndpoint(cluster));
|
|
22
|
-
const payer = config.payer ?? resolvePayerFromSecretKey(config.payerSecretKey);
|
|
23
|
-
return buildSolanaClient(endpoint, wsEndpoint, payer);
|
|
24
|
-
}
|
|
25
|
-
function resolvePayerFromSecretKey(payerSecretKey) {
|
|
26
|
-
if (!payerSecretKey) {
|
|
27
|
-
return void 0;
|
|
28
|
-
}
|
|
29
|
-
const invalidError = () => new Error(
|
|
30
|
-
"Invalid `payerSecretKey`: expected a base64-encoded 64-byte Ed25519 keypair (secret key first)."
|
|
31
|
-
);
|
|
32
|
-
let keyPairBytes;
|
|
33
|
-
try {
|
|
34
|
-
keyPairBytes = Uint8Array.from(kit.getBase64Encoder().encode(payerSecretKey));
|
|
35
|
-
} catch {
|
|
36
|
-
throw invalidError();
|
|
37
|
-
}
|
|
38
|
-
if (keyPairBytes.length !== 64) {
|
|
39
|
-
throw invalidError();
|
|
40
|
-
}
|
|
41
|
-
const address2 = kit.getBase58Decoder().decode(keyPairBytes.slice(32));
|
|
42
|
-
let privateKey;
|
|
43
|
-
const getPrivateKey = () => privateKey ??= (async () => {
|
|
44
|
-
if (!globalThis.crypto?.subtle) {
|
|
45
|
-
throw new Error(
|
|
46
|
-
"`payerSecretKey` signing needs WebCrypto, which browsers only expose in a secure context (https, or http on localhost)."
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
return (await kit.createKeyPairFromBytes(keyPairBytes)).privateKey;
|
|
50
|
-
})().catch((cause) => {
|
|
51
|
-
if (kit.isSolanaError(cause, kit.SOLANA_ERROR__KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY)) {
|
|
52
|
-
throw invalidError();
|
|
53
|
-
}
|
|
54
|
-
throw cause;
|
|
55
|
-
});
|
|
56
|
-
return {
|
|
57
|
-
address: address2,
|
|
58
|
-
async signTransactions(transactions, config) {
|
|
59
|
-
config?.abortSignal?.throwIfAborted();
|
|
60
|
-
const key = await getPrivateKey();
|
|
61
|
-
config?.abortSignal?.throwIfAborted();
|
|
62
|
-
return Promise.all(
|
|
63
|
-
transactions.map(async (transaction) => ({
|
|
64
|
-
[address2]: await kit.signBytes(key, transaction.messageBytes)
|
|
65
|
-
}))
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
exports.AccountRole = kit.AccountRole;
|
|
72
|
-
exports.address = kit.address;
|
|
73
|
-
exports.appendTransactionMessageInstruction = kit.appendTransactionMessageInstruction;
|
|
74
|
-
exports.compileTransaction = kit.compileTransaction;
|
|
75
|
-
exports.createReactiveActionStore = kit.createReactiveActionStore;
|
|
76
|
-
exports.createReactiveStoreWithInitialValueAndSlotTracking = kit.createReactiveStoreWithInitialValueAndSlotTracking;
|
|
77
|
-
exports.createTransactionMessage = kit.createTransactionMessage;
|
|
78
|
-
exports.extendClient = kit.extendClient;
|
|
79
|
-
exports.generateKeyPairSigner = kit.generateKeyPairSigner;
|
|
80
|
-
exports.getAbortablePromise = kit.getAbortablePromise;
|
|
81
|
-
exports.getTransactionEncoder = kit.getTransactionEncoder;
|
|
82
|
-
exports.isAbortError = kit.isAbortError;
|
|
83
|
-
exports.isAddress = kit.isAddress;
|
|
84
|
-
exports.lamports = kit.lamports;
|
|
85
|
-
exports.setTransactionMessageFeePayer = kit.setTransactionMessageFeePayer;
|
|
86
|
-
exports.setTransactionMessageLifetimeUsingBlockhash = kit.setTransactionMessageLifetimeUsingBlockhash;
|
|
87
|
-
exports.summarizeTransactionPlanResult = kit.summarizeTransactionPlanResult;
|
|
88
|
-
exports.createSolanaClient = createSolanaClient;
|
package/dist/kit.d.cts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
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';
|
|
3
|
-
export { b as SolanaClient, n as createSolanaClient } from './shared/core.C9vxHRXl.cjs';
|
package/dist/mobile-wallet.cjs
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const walletStandardMobile = require('@solana-mobile/wallet-standard-mobile');
|
|
4
|
-
|
|
5
|
-
const DEFAULT_MOBILE_WALLET_CHAINS = ["solana:mainnet", "solana:devnet"];
|
|
6
|
-
const registeredMobileWalletKeys = /* @__PURE__ */ new Set();
|
|
7
|
-
function registerSolanaMobileWallet(options = {}) {
|
|
8
|
-
if (!isSolanaMobileWalletSupported()) {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
const appIdentity = options.appIdentity ?? getDefaultMobileWalletAppIdentity();
|
|
12
|
-
const chains = options.chains?.length ? options.chains : DEFAULT_MOBILE_WALLET_CHAINS;
|
|
13
|
-
const registrationKey = JSON.stringify({
|
|
14
|
-
appIdentity,
|
|
15
|
-
chains,
|
|
16
|
-
remoteHostAuthority: options.remoteHostAuthority
|
|
17
|
-
});
|
|
18
|
-
if (registeredMobileWalletKeys.has(registrationKey)) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
walletStandardMobile.registerMwa({
|
|
22
|
-
appIdentity,
|
|
23
|
-
authorizationCache: walletStandardMobile.createDefaultAuthorizationCache(),
|
|
24
|
-
chains,
|
|
25
|
-
chainSelector: walletStandardMobile.createDefaultChainSelector(),
|
|
26
|
-
remoteHostAuthority: options.remoteHostAuthority,
|
|
27
|
-
onWalletNotFound: walletStandardMobile.createDefaultWalletNotFoundHandler()
|
|
28
|
-
});
|
|
29
|
-
registeredMobileWalletKeys.add(registrationKey);
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
function isSolanaMobileWalletSupported() {
|
|
33
|
-
if (typeof window === "undefined" || typeof navigator === "undefined") {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
const userAgent = navigator.userAgent;
|
|
37
|
-
const isAndroid = /Android/i.test(userAgent);
|
|
38
|
-
const isChrome = /Chrome|CriOS/i.test(userAgent) && !/Edg|OPR|Firefox|FxiOS/i.test(userAgent);
|
|
39
|
-
return isAndroid && isChrome;
|
|
40
|
-
}
|
|
41
|
-
function getDefaultMobileWalletAppIdentity() {
|
|
42
|
-
if (typeof window === "undefined") {
|
|
43
|
-
return {
|
|
44
|
-
name: "Vue Solana App",
|
|
45
|
-
uri: "https://localhost"
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
name: document.title || "Vue Solana App",
|
|
50
|
-
uri: window.location.origin,
|
|
51
|
-
icon: getDocumentIconPath()
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function getDocumentIconPath() {
|
|
55
|
-
const icon = document.querySelector(
|
|
56
|
-
'link[rel="icon"], link[rel="shortcut icon"], link[rel="apple-touch-icon"]'
|
|
57
|
-
);
|
|
58
|
-
if (!icon?.href) {
|
|
59
|
-
return void 0;
|
|
60
|
-
}
|
|
61
|
-
if (icon.href.startsWith(window.location.origin)) {
|
|
62
|
-
return icon.href.slice(window.location.origin.length).replace(/^\//, "");
|
|
63
|
-
}
|
|
64
|
-
return icon.href;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
exports.getDefaultMobileWalletAppIdentity = getDefaultMobileWalletAppIdentity;
|
|
68
|
-
exports.isSolanaMobileWalletSupported = isSolanaMobileWalletSupported;
|
|
69
|
-
exports.registerSolanaMobileWallet = registerSolanaMobileWallet;
|
package/dist/mobile-wallet.d.cts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { a as SolanaChain } from './shared/core.C9vxHRXl.cjs';
|
|
2
|
-
import '@solana/kit-plugin-rpc';
|
|
3
|
-
import '@solana/kit';
|
|
4
|
-
|
|
5
|
-
interface SolanaMobileWalletAppIdentity {
|
|
6
|
-
name: string;
|
|
7
|
-
uri: string;
|
|
8
|
-
icon?: string;
|
|
9
|
-
}
|
|
10
|
-
interface RegisterSolanaMobileWalletOptions {
|
|
11
|
-
appIdentity?: SolanaMobileWalletAppIdentity;
|
|
12
|
-
chains?: readonly SolanaChain[];
|
|
13
|
-
remoteHostAuthority?: string;
|
|
14
|
-
}
|
|
15
|
-
declare function registerSolanaMobileWallet(options?: RegisterSolanaMobileWalletOptions): boolean;
|
|
16
|
-
declare function isSolanaMobileWalletSupported(): boolean;
|
|
17
|
-
declare function getDefaultMobileWalletAppIdentity(): SolanaMobileWalletAppIdentity;
|
|
18
|
-
|
|
19
|
-
export { getDefaultMobileWalletAppIdentity, isSolanaMobileWalletSupported, registerSolanaMobileWallet };
|
|
20
|
-
export type { RegisterSolanaMobileWalletOptions, SolanaMobileWalletAppIdentity };
|
package/dist/rpc.cjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const clusters = require('./clusters.cjs');
|
|
4
|
-
const kit = require('./kit.cjs');
|
|
5
|
-
require('@solana/kit');
|
|
6
|
-
require('@solana/kit-plugin-rpc');
|
|
7
|
-
|
|
8
|
-
function createSolanaContext(config = {}) {
|
|
9
|
-
const cluster = config.cluster ?? clusters.DEFAULT_CLUSTER;
|
|
10
|
-
const endpoint = config.endpoint ?? clusters.getClusterEndpoint(cluster);
|
|
11
|
-
const wsEndpoint = config.wsEndpoint ?? (config.endpoint ? clusters.getWebSocketEndpoint(endpoint) : clusters.getClusterWebSocketEndpoint(cluster));
|
|
12
|
-
return {
|
|
13
|
-
cluster,
|
|
14
|
-
endpoint,
|
|
15
|
-
wsEndpoint,
|
|
16
|
-
client: kit.createSolanaClient(config)
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
exports.createSolanaContext = createSolanaContext;
|
package/dist/rpc.d.cts
DELETED