@shogun-sdk/one-shot
Version:
Shogun Network unified SDK — core logic, React hooks, and wallet adapters.
31 lines (28 loc) • 972 B
TypeScript
import { Transaction, VersionedTransaction } from '@solana/web3.js';
import { CustomTransport, HttpTransport } from 'viem';
type SolanaTransaction = Transaction | VersionedTransaction;
type EVMTransaction = {
data: string;
to: string;
from: string;
value: bigint | undefined;
};
type AnyTransaction = SolanaTransaction[] | EVMTransaction;
declare enum ChainVM {
EVM = "EVM",
SVM = "SVM",
MVM = "MVM"
}
type AdaptedWallet = {
vmType: ChainVM;
getChainId: () => Promise<number>;
address: () => Promise<string>;
switchChain: (chainId: number) => Promise<void>;
transport?: CustomTransport | HttpTransport;
sendTransaction: (transaction: AnyTransaction) => Promise<string | VersionedTransaction[]>;
signTypedData?: (signData: any) => Promise<string>;
rpcUrl?: string;
confirmTx?: (hash: `0x${string}`) => Promise<boolean>;
getLatestBlockhash?: () => Promise<string>;
};
export type { AdaptedWallet as A };