@vue-solana/vue 0.2.2 → 0.2.3
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 +25 -4
- package/dist/index.cjs +83 -194
- package/dist/index.d.cts +14 -77
- package/dist/index.d.mts +14 -77
- package/dist/index.d.ts +14 -77
- package/dist/index.mjs +71 -182
- package/dist/shared/vue.1M_c5FWA.mjs +46 -0
- package/dist/shared/vue.BMUEDN2t.mjs +28 -0
- package/dist/shared/vue.BSVxQ9Yi.cjs +30 -0
- package/dist/shared/vue.BqDzSepb.mjs +18 -0
- package/dist/shared/vue.C4tLiG3R.cjs +50 -0
- package/dist/shared/vue.COyyrsQU.cjs +20 -0
- package/dist/shared/vue.CTM6XQ47.cjs +19 -0
- package/dist/shared/vue.CjKm-Cw1.cjs +47 -0
- package/dist/shared/vue.CwPjPFN6.cjs +69 -0
- package/dist/shared/vue.CwhEmATP.cjs +9 -0
- package/dist/shared/vue.D81obqiN.mjs +45 -0
- package/dist/shared/vue.DGhodYJh.d.cts +20 -0
- package/dist/shared/vue.DGhodYJh.d.mts +20 -0
- package/dist/shared/vue.DGhodYJh.d.ts +20 -0
- package/dist/shared/vue.DYf_CRDv.mjs +67 -0
- package/dist/shared/vue.DlEAL2G8.mjs +7 -0
- package/dist/shared/vue.P9tgeC5S.cjs +15 -0
- package/dist/shared/vue.PoQ8Vpmy.mjs +17 -0
- package/dist/shared/vue.h-uS8MXN.mjs +13 -0
- package/dist/useBalance.cjs +11 -0
- package/dist/useBalance.d.cts +12 -0
- package/dist/useBalance.d.mts +12 -0
- package/dist/useBalance.d.ts +12 -0
- package/dist/useBalance.mjs +5 -0
- package/dist/useConnection.cjs +10 -0
- package/dist/useConnection.d.cts +3 -0
- package/dist/useConnection.d.mts +3 -0
- package/dist/useConnection.d.ts +3 -0
- package/dist/useConnection.mjs +4 -0
- package/dist/useRpc.cjs +9 -0
- package/dist/useRpc.d.cts +16 -0
- package/dist/useRpc.d.mts +16 -0
- package/dist/useRpc.d.ts +16 -0
- package/dist/useRpc.mjs +3 -0
- package/dist/useSignAndSendTransaction.cjs +14 -0
- package/dist/useSignAndSendTransaction.d.cts +11 -0
- package/dist/useSignAndSendTransaction.d.mts +11 -0
- package/dist/useSignAndSendTransaction.d.ts +11 -0
- package/dist/useSignAndSendTransaction.mjs +8 -0
- package/dist/useSolana.cjs +9 -0
- package/dist/useSolana.d.cts +8 -0
- package/dist/useSolana.d.mts +8 -0
- package/dist/useSolana.d.ts +8 -0
- package/dist/useSolana.mjs +2 -0
- package/dist/useTransaction.cjs +8 -0
- package/dist/useTransaction.d.cts +11 -0
- package/dist/useTransaction.d.mts +11 -0
- package/dist/useTransaction.d.ts +11 -0
- package/dist/useTransaction.mjs +2 -0
- package/dist/useWallet.cjs +9 -0
- package/dist/useWallet.d.cts +16 -0
- package/dist/useWallet.d.mts +16 -0
- package/dist/useWallet.d.ts +16 -0
- package/dist/useWallet.mjs +3 -0
- package/dist/useWallets.cjs +9 -0
- package/dist/useWallets.d.cts +11 -0
- package/dist/useWallets.d.mts +11 -0
- package/dist/useWallets.d.ts +11 -0
- package/dist/useWallets.mjs +3 -0
- package/package.json +41 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vue = require('vue');
|
|
4
|
+
const useSolana = require('./vue.C4tLiG3R.cjs');
|
|
5
|
+
|
|
6
|
+
function useWallet() {
|
|
7
|
+
const solana = useSolana.useSolana();
|
|
8
|
+
const wallet = solana.wallet;
|
|
9
|
+
const connecting = vue.ref(false);
|
|
10
|
+
const disconnecting = vue.ref(false);
|
|
11
|
+
async function connect() {
|
|
12
|
+
const activeWallet = wallet.value;
|
|
13
|
+
if (!activeWallet) {
|
|
14
|
+
throw new Error("No Solana wallet is configured");
|
|
15
|
+
}
|
|
16
|
+
connecting.value = true;
|
|
17
|
+
try {
|
|
18
|
+
const connection = activeWallet.connect();
|
|
19
|
+
vue.triggerRef(wallet);
|
|
20
|
+
await connection;
|
|
21
|
+
vue.triggerRef(wallet);
|
|
22
|
+
console.info("[Vue Solana] Wallet connected", {
|
|
23
|
+
publicKey: activeWallet.publicKey?.toBase58() ?? null
|
|
24
|
+
});
|
|
25
|
+
} catch (error) {
|
|
26
|
+
vue.triggerRef(wallet);
|
|
27
|
+
console.error("[Vue Solana] Wallet connection failed", error);
|
|
28
|
+
throw error;
|
|
29
|
+
} finally {
|
|
30
|
+
connecting.value = false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async function disconnect() {
|
|
34
|
+
const activeWallet = wallet.value;
|
|
35
|
+
if (!activeWallet) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const publicKey = activeWallet.publicKey?.toBase58() ?? null;
|
|
39
|
+
disconnecting.value = true;
|
|
40
|
+
try {
|
|
41
|
+
await activeWallet.disconnect();
|
|
42
|
+
vue.triggerRef(wallet);
|
|
43
|
+
console.info("[Vue Solana] Wallet disconnected", { publicKey });
|
|
44
|
+
} catch (error) {
|
|
45
|
+
vue.triggerRef(wallet);
|
|
46
|
+
console.error("[Vue Solana] Wallet disconnection failed", error);
|
|
47
|
+
throw error;
|
|
48
|
+
} finally {
|
|
49
|
+
disconnecting.value = false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const isConnecting = vue.computed(() => Boolean(connecting.value || wallet.value?.connecting));
|
|
53
|
+
const isDisconnecting = vue.computed(
|
|
54
|
+
() => Boolean(disconnecting.value || wallet.value?.disconnecting)
|
|
55
|
+
);
|
|
56
|
+
return {
|
|
57
|
+
wallet,
|
|
58
|
+
publicKey: vue.computed(() => wallet.value?.publicKey ?? null),
|
|
59
|
+
connected: vue.computed(() => Boolean(wallet.value?.connected && wallet.value.publicKey)),
|
|
60
|
+
connecting: isConnecting,
|
|
61
|
+
disconnecting: isDisconnecting,
|
|
62
|
+
loading: vue.computed(() => isConnecting.value || isDisconnecting.value),
|
|
63
|
+
setWallet: solana.setWallet,
|
|
64
|
+
connect,
|
|
65
|
+
disconnect
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
exports.useWallet = useWallet;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ref, watch, toValue } from 'vue';
|
|
2
|
+
import { u as useConnection } from './vue.DlEAL2G8.mjs';
|
|
3
|
+
import { t as tryUseSolana } from './vue.1M_c5FWA.mjs';
|
|
4
|
+
|
|
5
|
+
function useBalance(address, commitment) {
|
|
6
|
+
const solana = tryUseSolana();
|
|
7
|
+
const connection = solana?.connection ?? useConnection();
|
|
8
|
+
const balance = ref(null);
|
|
9
|
+
const loading = ref(false);
|
|
10
|
+
const error = ref(null);
|
|
11
|
+
async function refresh() {
|
|
12
|
+
const value = toValue(address);
|
|
13
|
+
if (!value || !solana) {
|
|
14
|
+
balance.value = null;
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
loading.value = true;
|
|
18
|
+
error.value = null;
|
|
19
|
+
try {
|
|
20
|
+
const publicKey = typeof value === "string" ? new (await import('@solana/web3-compat')).PublicKey(value) : value;
|
|
21
|
+
balance.value = await connection.getBalance(publicKey, commitment);
|
|
22
|
+
return balance.value;
|
|
23
|
+
} catch (cause) {
|
|
24
|
+
error.value = cause;
|
|
25
|
+
throw cause;
|
|
26
|
+
} finally {
|
|
27
|
+
loading.value = false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
watch(
|
|
31
|
+
() => toValue(address),
|
|
32
|
+
() => {
|
|
33
|
+
void refresh().catch(() => void 0);
|
|
34
|
+
},
|
|
35
|
+
{ immediate: true }
|
|
36
|
+
);
|
|
37
|
+
return {
|
|
38
|
+
balance,
|
|
39
|
+
loading,
|
|
40
|
+
error,
|
|
41
|
+
refresh
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { useBalance as u };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SolanaContext, SolanaWallet, SolanaWalletInfo } from '@vue-solana/core/types';
|
|
2
|
+
import { Ref, InjectionKey } from 'vue';
|
|
3
|
+
|
|
4
|
+
type SolanaConnectionStatus = "idle" | "checking" | "connected" | "error";
|
|
5
|
+
interface VueSolanaContext extends SolanaContext {
|
|
6
|
+
wallet: Ref<SolanaWallet | null>;
|
|
7
|
+
status: Ref<SolanaConnectionStatus>;
|
|
8
|
+
error: Ref<string | null>;
|
|
9
|
+
latestBlockhash: Ref<string | null>;
|
|
10
|
+
wallets: Ref<SolanaWalletInfo[]>;
|
|
11
|
+
selectedWallet: Ref<SolanaWalletInfo | null>;
|
|
12
|
+
checkConnection: () => Promise<void>;
|
|
13
|
+
setWallet: (wallet: SolanaWallet | null) => void;
|
|
14
|
+
refreshWallets: () => void;
|
|
15
|
+
selectWallet: (wallet: SolanaWalletInfo | null) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const solanaInjectionKey: InjectionKey<VueSolanaContext>;
|
|
18
|
+
|
|
19
|
+
export { solanaInjectionKey as s };
|
|
20
|
+
export type { SolanaConnectionStatus as S, VueSolanaContext as V };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SolanaContext, SolanaWallet, SolanaWalletInfo } from '@vue-solana/core/types';
|
|
2
|
+
import { Ref, InjectionKey } from 'vue';
|
|
3
|
+
|
|
4
|
+
type SolanaConnectionStatus = "idle" | "checking" | "connected" | "error";
|
|
5
|
+
interface VueSolanaContext extends SolanaContext {
|
|
6
|
+
wallet: Ref<SolanaWallet | null>;
|
|
7
|
+
status: Ref<SolanaConnectionStatus>;
|
|
8
|
+
error: Ref<string | null>;
|
|
9
|
+
latestBlockhash: Ref<string | null>;
|
|
10
|
+
wallets: Ref<SolanaWalletInfo[]>;
|
|
11
|
+
selectedWallet: Ref<SolanaWalletInfo | null>;
|
|
12
|
+
checkConnection: () => Promise<void>;
|
|
13
|
+
setWallet: (wallet: SolanaWallet | null) => void;
|
|
14
|
+
refreshWallets: () => void;
|
|
15
|
+
selectWallet: (wallet: SolanaWalletInfo | null) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const solanaInjectionKey: InjectionKey<VueSolanaContext>;
|
|
18
|
+
|
|
19
|
+
export { solanaInjectionKey as s };
|
|
20
|
+
export type { SolanaConnectionStatus as S, VueSolanaContext as V };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SolanaContext, SolanaWallet, SolanaWalletInfo } from '@vue-solana/core/types';
|
|
2
|
+
import { Ref, InjectionKey } from 'vue';
|
|
3
|
+
|
|
4
|
+
type SolanaConnectionStatus = "idle" | "checking" | "connected" | "error";
|
|
5
|
+
interface VueSolanaContext extends SolanaContext {
|
|
6
|
+
wallet: Ref<SolanaWallet | null>;
|
|
7
|
+
status: Ref<SolanaConnectionStatus>;
|
|
8
|
+
error: Ref<string | null>;
|
|
9
|
+
latestBlockhash: Ref<string | null>;
|
|
10
|
+
wallets: Ref<SolanaWalletInfo[]>;
|
|
11
|
+
selectedWallet: Ref<SolanaWalletInfo | null>;
|
|
12
|
+
checkConnection: () => Promise<void>;
|
|
13
|
+
setWallet: (wallet: SolanaWallet | null) => void;
|
|
14
|
+
refreshWallets: () => void;
|
|
15
|
+
selectWallet: (wallet: SolanaWalletInfo | null) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const solanaInjectionKey: InjectionKey<VueSolanaContext>;
|
|
18
|
+
|
|
19
|
+
export { solanaInjectionKey as s };
|
|
20
|
+
export type { SolanaConnectionStatus as S, VueSolanaContext as V };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ref, computed, triggerRef } from 'vue';
|
|
2
|
+
import { u as useSolana } from './vue.1M_c5FWA.mjs';
|
|
3
|
+
|
|
4
|
+
function useWallet() {
|
|
5
|
+
const solana = useSolana();
|
|
6
|
+
const wallet = solana.wallet;
|
|
7
|
+
const connecting = ref(false);
|
|
8
|
+
const disconnecting = ref(false);
|
|
9
|
+
async function connect() {
|
|
10
|
+
const activeWallet = wallet.value;
|
|
11
|
+
if (!activeWallet) {
|
|
12
|
+
throw new Error("No Solana wallet is configured");
|
|
13
|
+
}
|
|
14
|
+
connecting.value = true;
|
|
15
|
+
try {
|
|
16
|
+
const connection = activeWallet.connect();
|
|
17
|
+
triggerRef(wallet);
|
|
18
|
+
await connection;
|
|
19
|
+
triggerRef(wallet);
|
|
20
|
+
console.info("[Vue Solana] Wallet connected", {
|
|
21
|
+
publicKey: activeWallet.publicKey?.toBase58() ?? null
|
|
22
|
+
});
|
|
23
|
+
} catch (error) {
|
|
24
|
+
triggerRef(wallet);
|
|
25
|
+
console.error("[Vue Solana] Wallet connection failed", error);
|
|
26
|
+
throw error;
|
|
27
|
+
} finally {
|
|
28
|
+
connecting.value = false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function disconnect() {
|
|
32
|
+
const activeWallet = wallet.value;
|
|
33
|
+
if (!activeWallet) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const publicKey = activeWallet.publicKey?.toBase58() ?? null;
|
|
37
|
+
disconnecting.value = true;
|
|
38
|
+
try {
|
|
39
|
+
await activeWallet.disconnect();
|
|
40
|
+
triggerRef(wallet);
|
|
41
|
+
console.info("[Vue Solana] Wallet disconnected", { publicKey });
|
|
42
|
+
} catch (error) {
|
|
43
|
+
triggerRef(wallet);
|
|
44
|
+
console.error("[Vue Solana] Wallet disconnection failed", error);
|
|
45
|
+
throw error;
|
|
46
|
+
} finally {
|
|
47
|
+
disconnecting.value = false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const isConnecting = computed(() => Boolean(connecting.value || wallet.value?.connecting));
|
|
51
|
+
const isDisconnecting = computed(
|
|
52
|
+
() => Boolean(disconnecting.value || wallet.value?.disconnecting)
|
|
53
|
+
);
|
|
54
|
+
return {
|
|
55
|
+
wallet,
|
|
56
|
+
publicKey: computed(() => wallet.value?.publicKey ?? null),
|
|
57
|
+
connected: computed(() => Boolean(wallet.value?.connected && wallet.value.publicKey)),
|
|
58
|
+
connecting: isConnecting,
|
|
59
|
+
disconnecting: isDisconnecting,
|
|
60
|
+
loading: computed(() => isConnecting.value || isDisconnecting.value),
|
|
61
|
+
setWallet: solana.setWallet,
|
|
62
|
+
connect,
|
|
63
|
+
disconnect
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { useWallet as u };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const useSolana = require('./vue.C4tLiG3R.cjs');
|
|
4
|
+
|
|
5
|
+
function useWallets() {
|
|
6
|
+
const solana = useSolana.useSolana();
|
|
7
|
+
return {
|
|
8
|
+
wallets: solana.wallets,
|
|
9
|
+
selectedWallet: solana.selectedWallet,
|
|
10
|
+
refreshWallets: solana.refreshWallets,
|
|
11
|
+
selectWallet: solana.selectWallet
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
exports.useWallets = useWallets;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { signAndSendTransaction } from '@vue-solana/core/transaction';
|
|
2
|
+
import { u as useConnection } from './vue.DlEAL2G8.mjs';
|
|
3
|
+
import { u as useWallet } from './vue.DYf_CRDv.mjs';
|
|
4
|
+
import { u as useTransaction } from './vue.BMUEDN2t.mjs';
|
|
5
|
+
|
|
6
|
+
function useSignAndSendTransaction() {
|
|
7
|
+
const connection = useConnection();
|
|
8
|
+
const { wallet } = useWallet();
|
|
9
|
+
return useTransaction((transaction, options) => {
|
|
10
|
+
if (!wallet.value) {
|
|
11
|
+
return Promise.reject(new Error("No Solana wallet is configured"));
|
|
12
|
+
}
|
|
13
|
+
return signAndSendTransaction(connection, wallet.value, transaction, options);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { useSignAndSendTransaction as u };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { u as useSolana } from './vue.1M_c5FWA.mjs';
|
|
2
|
+
|
|
3
|
+
function useWallets() {
|
|
4
|
+
const solana = useSolana();
|
|
5
|
+
return {
|
|
6
|
+
wallets: solana.wallets,
|
|
7
|
+
selectedWallet: solana.selectedWallet,
|
|
8
|
+
refreshWallets: solana.refreshWallets,
|
|
9
|
+
selectWallet: solana.selectWallet
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { useWallets as u };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const useBalance = require('./shared/vue.CjKm-Cw1.cjs');
|
|
4
|
+
require('vue');
|
|
5
|
+
require('./shared/vue.CwhEmATP.cjs');
|
|
6
|
+
require('./shared/vue.COyyrsQU.cjs');
|
|
7
|
+
require('./shared/vue.C4tLiG3R.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.useBalance = useBalance.useBalance;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
3
|
+
import { PublicKey, Commitment } from '@solana/web3-compat';
|
|
4
|
+
|
|
5
|
+
declare function useBalance(address: MaybeRefOrGetter<PublicKey | string | null | undefined>, commitment?: Commitment): {
|
|
6
|
+
balance: vue.Ref<number | null, number | null>;
|
|
7
|
+
loading: vue.Ref<boolean, boolean>;
|
|
8
|
+
error: vue.Ref<unknown, unknown>;
|
|
9
|
+
refresh: () => Promise<number | null>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { useBalance };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
3
|
+
import { PublicKey, Commitment } from '@solana/web3-compat';
|
|
4
|
+
|
|
5
|
+
declare function useBalance(address: MaybeRefOrGetter<PublicKey | string | null | undefined>, commitment?: Commitment): {
|
|
6
|
+
balance: vue.Ref<number | null, number | null>;
|
|
7
|
+
loading: vue.Ref<boolean, boolean>;
|
|
8
|
+
error: vue.Ref<unknown, unknown>;
|
|
9
|
+
refresh: () => Promise<number | null>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { useBalance };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
3
|
+
import { PublicKey, Commitment } from '@solana/web3-compat';
|
|
4
|
+
|
|
5
|
+
declare function useBalance(address: MaybeRefOrGetter<PublicKey | string | null | undefined>, commitment?: Commitment): {
|
|
6
|
+
balance: vue.Ref<number | null, number | null>;
|
|
7
|
+
loading: vue.Ref<boolean, boolean>;
|
|
8
|
+
error: vue.Ref<unknown, unknown>;
|
|
9
|
+
refresh: () => Promise<number | null>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { useBalance };
|
package/dist/useRpc.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import * as _vue_solana_core_types from '@vue-solana/core/types';
|
|
3
|
+
import { S as SolanaConnectionStatus } from './shared/vue.DGhodYJh.cjs';
|
|
4
|
+
|
|
5
|
+
declare function useRpc(): {
|
|
6
|
+
cluster: vue.ComputedRef<_vue_solana_core_types.SolanaCluster>;
|
|
7
|
+
endpoint: vue.ComputedRef<string>;
|
|
8
|
+
wsEndpoint: vue.ComputedRef<string>;
|
|
9
|
+
status: vue.Ref<SolanaConnectionStatus, SolanaConnectionStatus>;
|
|
10
|
+
error: vue.Ref<string | null, string | null>;
|
|
11
|
+
latestBlockhash: vue.Ref<string | null, string | null>;
|
|
12
|
+
checkConnection: () => Promise<void>;
|
|
13
|
+
connection: Connection;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { useRpc };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import * as _vue_solana_core_types from '@vue-solana/core/types';
|
|
3
|
+
import { S as SolanaConnectionStatus } from './shared/vue.DGhodYJh.mjs';
|
|
4
|
+
|
|
5
|
+
declare function useRpc(): {
|
|
6
|
+
cluster: vue.ComputedRef<_vue_solana_core_types.SolanaCluster>;
|
|
7
|
+
endpoint: vue.ComputedRef<string>;
|
|
8
|
+
wsEndpoint: vue.ComputedRef<string>;
|
|
9
|
+
status: vue.Ref<SolanaConnectionStatus, SolanaConnectionStatus>;
|
|
10
|
+
error: vue.Ref<string | null, string | null>;
|
|
11
|
+
latestBlockhash: vue.Ref<string | null, string | null>;
|
|
12
|
+
checkConnection: () => Promise<void>;
|
|
13
|
+
connection: Connection;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { useRpc };
|
package/dist/useRpc.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import * as _vue_solana_core_types from '@vue-solana/core/types';
|
|
3
|
+
import { S as SolanaConnectionStatus } from './shared/vue.DGhodYJh.js';
|
|
4
|
+
|
|
5
|
+
declare function useRpc(): {
|
|
6
|
+
cluster: vue.ComputedRef<_vue_solana_core_types.SolanaCluster>;
|
|
7
|
+
endpoint: vue.ComputedRef<string>;
|
|
8
|
+
wsEndpoint: vue.ComputedRef<string>;
|
|
9
|
+
status: vue.Ref<SolanaConnectionStatus, SolanaConnectionStatus>;
|
|
10
|
+
error: vue.Ref<string | null, string | null>;
|
|
11
|
+
latestBlockhash: vue.Ref<string | null, string | null>;
|
|
12
|
+
checkConnection: () => Promise<void>;
|
|
13
|
+
connection: Connection;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { useRpc };
|
package/dist/useRpc.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const useSignAndSendTransaction = require('./shared/vue.CTM6XQ47.cjs');
|
|
4
|
+
require('@vue-solana/core/transaction');
|
|
5
|
+
require('./shared/vue.CwhEmATP.cjs');
|
|
6
|
+
require('./shared/vue.COyyrsQU.cjs');
|
|
7
|
+
require('vue');
|
|
8
|
+
require('./shared/vue.C4tLiG3R.cjs');
|
|
9
|
+
require('./shared/vue.CwPjPFN6.cjs');
|
|
10
|
+
require('./shared/vue.BSVxQ9Yi.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.useSignAndSendTransaction = useSignAndSendTransaction.useSignAndSendTransaction;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { SendTransactionOptions } from '@vue-solana/core/types';
|
|
3
|
+
|
|
4
|
+
declare function useSignAndSendTransaction(): {
|
|
5
|
+
signature: any;
|
|
6
|
+
loading: vue.Ref<boolean, boolean>;
|
|
7
|
+
error: vue.Ref<unknown, unknown>;
|
|
8
|
+
execute: (transaction: any, options?: SendTransactionOptions | undefined) => Promise<any>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { useSignAndSendTransaction };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { SendTransactionOptions } from '@vue-solana/core/types';
|
|
3
|
+
|
|
4
|
+
declare function useSignAndSendTransaction(): {
|
|
5
|
+
signature: any;
|
|
6
|
+
loading: vue.Ref<boolean, boolean>;
|
|
7
|
+
error: vue.Ref<unknown, unknown>;
|
|
8
|
+
execute: (transaction: any, options?: SendTransactionOptions | undefined) => Promise<any>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { useSignAndSendTransaction };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { SendTransactionOptions } from '@vue-solana/core/types';
|
|
3
|
+
|
|
4
|
+
declare function useSignAndSendTransaction(): {
|
|
5
|
+
signature: any;
|
|
6
|
+
loading: vue.Ref<boolean, boolean>;
|
|
7
|
+
error: vue.Ref<unknown, unknown>;
|
|
8
|
+
execute: (transaction: any, options?: SendTransactionOptions | undefined) => Promise<any>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { useSignAndSendTransaction };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { u as useSignAndSendTransaction } from './shared/vue.PoQ8Vpmy.mjs';
|
|
2
|
+
import '@vue-solana/core/transaction';
|
|
3
|
+
import './shared/vue.DlEAL2G8.mjs';
|
|
4
|
+
import './shared/vue.BqDzSepb.mjs';
|
|
5
|
+
import 'vue';
|
|
6
|
+
import './shared/vue.1M_c5FWA.mjs';
|
|
7
|
+
import './shared/vue.DYf_CRDv.mjs';
|
|
8
|
+
import './shared/vue.BMUEDN2t.mjs';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { V as VueSolanaContext } from './shared/vue.DGhodYJh.cjs';
|
|
2
|
+
import '@vue-solana/core/types';
|
|
3
|
+
import 'vue';
|
|
4
|
+
|
|
5
|
+
declare function tryUseSolana(): VueSolanaContext | null;
|
|
6
|
+
declare function useSolana(): VueSolanaContext;
|
|
7
|
+
|
|
8
|
+
export { tryUseSolana, useSolana };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { V as VueSolanaContext } from './shared/vue.DGhodYJh.mjs';
|
|
2
|
+
import '@vue-solana/core/types';
|
|
3
|
+
import 'vue';
|
|
4
|
+
|
|
5
|
+
declare function tryUseSolana(): VueSolanaContext | null;
|
|
6
|
+
declare function useSolana(): VueSolanaContext;
|
|
7
|
+
|
|
8
|
+
export { tryUseSolana, useSolana };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { V as VueSolanaContext } from './shared/vue.DGhodYJh.js';
|
|
2
|
+
import '@vue-solana/core/types';
|
|
3
|
+
import 'vue';
|
|
4
|
+
|
|
5
|
+
declare function tryUseSolana(): VueSolanaContext | null;
|
|
6
|
+
declare function useSolana(): VueSolanaContext;
|
|
7
|
+
|
|
8
|
+
export { tryUseSolana, useSolana };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { TransactionSignature } from '@solana/web3-compat';
|
|
3
|
+
|
|
4
|
+
declare function useTransaction<TArgs extends unknown[]>(handler: (...args: TArgs) => Promise<TransactionSignature>): {
|
|
5
|
+
signature: any;
|
|
6
|
+
loading: vue.Ref<boolean, boolean>;
|
|
7
|
+
error: vue.Ref<unknown, unknown>;
|
|
8
|
+
execute: (...args: TArgs) => Promise<any>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { useTransaction };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { TransactionSignature } from '@solana/web3-compat';
|
|
3
|
+
|
|
4
|
+
declare function useTransaction<TArgs extends unknown[]>(handler: (...args: TArgs) => Promise<TransactionSignature>): {
|
|
5
|
+
signature: any;
|
|
6
|
+
loading: vue.Ref<boolean, boolean>;
|
|
7
|
+
error: vue.Ref<unknown, unknown>;
|
|
8
|
+
execute: (...args: TArgs) => Promise<any>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { useTransaction };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { TransactionSignature } from '@solana/web3-compat';
|
|
3
|
+
|
|
4
|
+
declare function useTransaction<TArgs extends unknown[]>(handler: (...args: TArgs) => Promise<TransactionSignature>): {
|
|
5
|
+
signature: any;
|
|
6
|
+
loading: vue.Ref<boolean, boolean>;
|
|
7
|
+
error: vue.Ref<unknown, unknown>;
|
|
8
|
+
execute: (...args: TArgs) => Promise<any>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { useTransaction };
|