Skip to content

Commit 229c003

Browse files
committed
nits
1 parent 2b69629 commit 229c003

File tree

14 files changed

+2408
-3623
lines changed

14 files changed

+2408
-3623
lines changed

web-modal-sdk/quick-starts/react-modal-solana-quick-start/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import "./App.css";
22
import { useWeb3AuthConnect, useWeb3AuthDisconnect, useWeb3AuthUser} from "@web3auth/modal/react";
33
import { WALLET_CONNECTORS } from "@web3auth/modal";
44
import { useSolanaWallet } from "@web3auth/modal/react/solana";
5-
import { SendTransaction } from "./components/sendTransaction";
5+
import { SignTransaction } from "./components/signTransaction";
66
import { Balance } from "./components/getBalance";
77
import { SendVersionedTransaction } from "./components/sendVersionedTransaction";
88
import { SignMessage } from "./components/signMessage";
@@ -41,7 +41,7 @@ function App() {
4141
</div>
4242
<Balance />
4343
<SignMessage />
44-
<SendTransaction />
44+
<SignTransaction />
4545
<SendVersionedTransaction />
4646
<SwitchChain />
4747
</div>

web-modal-sdk/quick-starts/react-modal-solana-quick-start/src/components/sendTransaction.tsx renamed to web-modal-sdk/quick-starts/react-modal-solana-quick-start/src/components/signTransaction.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { FormEvent } from "react";
2-
import { useSolanaWallet, useSignAndSendTransaction } from "@web3auth/modal/react/solana";
2+
import { useSolanaWallet, useSignTransaction } from "@web3auth/modal/react/solana";
33
import { LAMPORTS_PER_SOL, PublicKey, SystemProgram, Transaction } from "@solana/web3.js";
44

5-
export function SendTransaction() {
6-
const { data: hash, error, loading: isPending, signAndSendTransaction } = useSignAndSendTransaction();
5+
export function SignTransaction() {
6+
const { data: signedTransaction, error, loading: isPending, signTransaction,
7+
} = useSignTransaction();
78
const { accounts, connection } = useSolanaWallet();
89

910
async function submit(e: FormEvent<HTMLFormElement>) {
@@ -25,13 +26,13 @@ export function SendTransaction() {
2526
feePayer: new PublicKey(accounts![0]),
2627
}).add(TransactionInstruction);
2728

28-
signAndSendTransaction(transaction);
29+
signTransaction(transaction);
2930
}
3031

3132

3233
return (
3334
<div>
34-
<h2>Send Transaction</h2>
35+
<h2>Sign Transaction</h2>
3536
<form onSubmit={submit}>
3637
<input name="address" placeholder="Address" required />
3738
<input
@@ -42,10 +43,10 @@ export function SendTransaction() {
4243
required
4344
/>
4445
<button disabled={isPending} type="submit" >
45-
{isPending ? 'Confirming...' : 'Send'}
46+
{isPending ? 'Signing...' : 'Sign'}
4647
</button>
4748
</form>
48-
{hash && <div>Transaction Hash: {hash}</div>}
49+
{signedTransaction && <div>Signed Trasaction: {signedTransaction}</div>}
4950
{error && (
5051
<div>Error: {error.message}</div>
5152
)}

web-modal-sdk/quick-starts/react-modal-solana-quick-start/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"noEmit": true,
1717
"jsx": "react-jsx"
1818
},
19-
"include": ["src", "src/components/sendTransaction.tsx", "src/components/switchNetwork.tsx", "src/components/writeContract.tsx", "src/components/getBalance.tsx"],
19+
"include": ["src", "src/components/signTransaction.tsx", "src/components/switchNetwork.tsx", "src/components/writeContract.tsx", "src/components/getBalance.tsx"],
2020
"references": [{ "path": "./tsconfig.node.json" }]
2121
}

web-modal-sdk/quick-starts/vue-modal-solana-quick-start/src/Home.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</div>
3838
<Balance v-if="isConnected" />
3939
<SignMessage v-if="isConnected" />
40-
<SendTransaction v-if="isConnected" />
40+
<SignTransaction v-if="isConnected" />
4141
<SendVersionedTransaction v-if="isConnected" />
4242
<SwitchNetwork v-if="isConnected" />
4343

@@ -61,7 +61,7 @@ import { WALLET_CONNECTORS, AUTH_CONNECTION } from "@web3auth/modal";
6161
import { useSolanaWallet } from "@web3auth/modal/vue/solana";
6262
6363
import Balance from './components/getBalance.vue';
64-
import SendTransaction from './components/sendTransaction.vue';
64+
import SignTransaction from './components/signTransaction.vue';
6565
import SwitchNetwork from './components/switchNetwork.vue';
6666
import SendVersionedTransaction from "./components/sendVersionedTransaction.vue";
6767
import SignMessage from "./components/signMessage.vue";

web-modal-sdk/quick-starts/vue-modal-solana-quick-start/src/components/sendTransaction.vue renamed to web-modal-sdk/quick-starts/vue-modal-solana-quick-start/src/components/signTransaction.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
22
import { LAMPORTS_PER_SOL, PublicKey, SystemProgram, Transaction } from "@solana/web3.js";
3-
import { useSolanaWallet, useSignAndSendTransaction } from "@web3auth/modal/vue/solana";
3+
import { useSolanaWallet, useSignTransaction } from "@web3auth/modal/vue/solana";
44
5-
const { data: hash, error, loading: isPending, signAndSendTransaction } = useSignAndSendTransaction();
5+
const { data: signedTransaction, error, loading: isPending, signTransaction } = useSignTransaction();
66
const { accounts, connection } = useSolanaWallet();
77
88
async function submit(event: Event) {
@@ -26,14 +26,14 @@ async function submit(event: Event) {
2626
feePayer: new PublicKey(accounts.value[0]),
2727
}).add(TransactionInstruction);
2828
29-
signAndSendTransaction(transaction);
29+
signTransaction(transaction);
3030
}
3131
</script>
3232

3333
<template>
3434
<div class="container">
3535
<div class="stack">
36-
<h2>Send Transaction</h2>
36+
<h2>Sign Transaction</h2>
3737
<form class="set" @submit.prevent="submit">
3838
<input name="address" placeholder="Address" required />
3939
<input
@@ -44,11 +44,10 @@ async function submit(event: Event) {
4444
required
4545
/>
4646
<button type="submit" :disabled="isPending">
47-
{{ isPending ? 'Confirming...' : 'Send' }}
47+
{{ isPending ? 'Signing...' : 'Sign' }}
4848
</button>
4949
</form>
50-
<div v-if="hash">Transaction Hash: {{ hash }}</div>
51-
<div v-if="isPending">Confirming...</div>
50+
<div v-if="signedTransaction">Signed Transaction: {{ signedTransaction }}</div>
5251
<div v-if="error">
5352
Error: {{ error.message }}
5453
</div>

0 commit comments

Comments
 (0)