Observed since 21 Oct, 11:29 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Shogun SDK React
The Shogun SDK React is a TypeScript library that enables cross-chain swaps and transfers between EVM chains and Solana. It provides quote fetching, transaction execution, and fee management capabilities.
npm install @0xshogun/sdk-react
or
yarn add @0xshogun/sdk-react
import { useShogunQuote } from '@0xshogun/sdk';
...
function SwapComponent() {
const { quote, isLoading, error } = useShogunQuote({
fromChain: 'ethereum',
toChain: 'solana',
fromToken: '0x...',
toToken: '...',
amount: '1000000000000000000'
});
}
'use client';
import { useSwap } from '@/store';
import { ShogunBalancesProvider, ShogunQuoteProvider, Token } from '@0xshogun/sdk';
import { useMemo } from 'react';
export const ShogunProvider = ({ children }: { children: React.ReactNode }) => {
const {
inputAmount,
tokenIn,
tokenOut,
recipientAddress,
slippage,
setLatestSuggestedAutoSlippageValue,
setInputAmount,
dynamicSlippage // true/false, only for Solana transactions
} = useSwap(); // Your swaps store
const yourAddresses = {....} // Here your wallet addresses
const affiliateWallets = useMemo(() => {
return {
solana: process.env.NEXT_PUBLIC_SOLANA_AFFILIATE_WALLET!, // Your affiliate wallet on solana
evm: process.env.NEXT_PUBLIC_EVM_AFFILIATE_WALLET!, // Your affiliate wallet on evm chains
};
}, []);
const api = useMemo(() => {
return {
key: process.env.NEXT_PUBLIC_DEXTRA_X_API_KEY!, // Dextra API keys
url: process.env.NEXT_PUBLIC_DEXTRA_URL!, // Dextra API URL
};
}, []);
return (
<ShogunBalancesProvider apiKey={process.env.NEXT_PUBLIC_CODEX_API!}>
<ShogunQuoteProvider
swap={{
tokenIn: tokenIn as Token,
tokenOut: tokenOut as Token,
setLatestSuggestedAutoSlippageValue,
inputAmount,
setInputAmount,
recipientAddress,
slippage,
}}
system={{
api,
systemFeePercent: 0.01,
userEVMAddress: yourAddresses?.turnKeyEVMAddress as string,
userSolanaAddress: yourAddresses?.turnkeySolanaAddress as string,
affiliateWallets,
}}
>
{children}
</ShogunQuoteProvider>
</ShogunBalancesProvider>
);
};
Development
npm install
npm run build
npm test
npm run format
npm run lint
Contributing Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.1.65Registry latest | 28 Mar 2025 | 43 | |
| 1.1.65-beta | 26 Mar 2025 | 43 | |
| 1.1.64-beta | 26 Mar 2025 | 43 | |
| 1.1.63 | 25 Mar 2025 | 43 | |
| 1.1.62 | 25 Mar 2025 | 43 | |
| 1.1.61 | 25 Mar 2025 | 43 | |
| 1.1.60 | 25 Mar 2025 | 43 | |
| 1.1.59 | 25 Mar 2025 | 43 | |
| 1.1.58 | 25 Mar 2025 | 43 | |
| 1.1.57 | 25 Mar 2025 | 43 | |
| 1.1.56 | 24 Mar 2025 | 43 | |
| 1.1.55 | 24 Mar 2025 | 43 | |
| 1.1.54 | 21 Mar 2025 | 43 | |
| 1.1.53 | 21 Mar 2025 | 43 | |
| 1.1.52 | 21 Mar 2025 | 43 | |
| 1.1.51 | 20 Mar 2025 | 43 | |
| 1.1.49 | 19 Mar 2025 | 38 | |
| 1.1.48 | 19 Mar 2025 | 38 | |
| 1.1.47 | 18 Mar 2025 | 38 | |
| 1.1.45 | 18 Mar 2025 | 38 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 11:29 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:193f662d3288d1727cb557f308ca2967693aedd2eed7fbff4e210ad32acf17e8