-
Notifications
You must be signed in to change notification settings - Fork 199
chore: add the links to the components for sdk and site #1557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,6 +149,12 @@ navigation: | |
| path: wallets/pages/reference/account-kit/react/hooks/useSignTypedData.mdx | ||
| - page: useWaitForUserOperationTransaction | ||
| path: wallets/pages/reference/account-kit/react/hooks/useWaitForUserOperationTransaction.mdx | ||
| - section: Solana Actions | ||
| contents: | ||
| - page: useSolanaTransaction | ||
| path: wallets/pages/reference/account-kit/react/hooks/useSolanaTransaction.mdx | ||
| - page: useSolanaSigner | ||
| path: wallets/pages/reference/account-kit/react/hooks/useSolanaSigner.mdx | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be |
||
| - section: Bundler/RPC Client | ||
| contents: | ||
| - page: useBundlerClient | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -394,4 +394,68 @@ export default function Home() { | |
| </main> | ||
| ); | ||
| } | ||
| c; | ||
Blu-J marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ## Other examples | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably should remove this, I didn't know where to put, then I found that the components where already being rendered |
||
|
|
||
| ### Sending a solana transaction | ||
|
|
||
| This is with the assumption that we have logged in, and we want a component to send a transaction | ||
|
|
||
| ```tsx twoslash | ||
| import React from "react"; | ||
| import { useSolanaTransaction } from "@account-kit/react"; | ||
| import { Connection } from "@solana/web3.js"; | ||
|
|
||
| function MyComponent() { | ||
| const connection = new Connection( | ||
| "https://solana-devnet.g.alchemy.com/v2/<API_KEY>", | ||
| { | ||
| wsEndpoint: "wss://api.devnet.solana.com", | ||
| commitment: "confirmed", | ||
| } | ||
| ); | ||
|
|
||
| const { | ||
| mutate: doTransaction, | ||
| isPending, | ||
| signer, | ||
| reset, | ||
| data: { hash: txHash = null } = {}, | ||
| } = useSolanaTransaction({ | ||
| connection, | ||
| }); | ||
|
|
||
| if (!signer) { | ||
| return <div>Loading alchemy signer...</div>; | ||
| } | ||
|
|
||
| return ( | ||
| <div> | ||
| Solana Address {signer.address} | ||
| <button | ||
| onClick={() => | ||
| doTransaction({ | ||
| transfer: { | ||
| amount: 1000000, | ||
| toAddress: "<ToSolanaAddress>", | ||
| }, | ||
| }) | ||
| } | ||
| > | ||
| Go make Transfer | ||
| </button> | ||
| {!!txHash && <button onClick={() => reset()}> Reset </button>} | ||
| {!!txHash && ( | ||
| <a | ||
| href={`https://explorer.solana.com/tx/${txHash}?cluster=devnet`} | ||
| target="_blank" | ||
| > | ||
| Go To Tracker | ||
| </a> | ||
| )} | ||
| </div> | ||
| ); | ||
| } | ||
| ``` | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,7 @@ const hookGroupings = { | |
| "useClientActions", | ||
| "useChain", | ||
| ], | ||
| "Solana Actions": ["useSolanaTransaction", "useSolanaSignMessage"], | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was the biggest aha moment
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @moldy530 What about the provider? Should I make a context or make it part of the other alchemy provider, and should I add this in as a seperate config field, or part of chain setup, which I have to filter now I think for viem vs not |
||
| "Bundler/RPC Client": ["useBundlerClient"], | ||
| Utilities: [ | ||
| "useAlchemyAccountContext", | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some docs