Putting It All Together
In this guide, we'll showcase how to get the most of the SDK in a real-life project
SDK instantiation
// Context
export interface SDKContextData {
sdk: IonicSdk;
address: string;
disconnect: () => void;
currentChain: Chain & {
unsupported?: boolean | undefined;
};
chains: Chain[];
}
export const SDKContext = createContext<SDKContextData | undefined>(undefined);
// Hook
export function useSDK() {
const context = useContext(SDKContext);
if (context === undefined) {
throw new Error(`useSDK must be used within a SDKProvider`);
}
return context;
}
...
const { sdk, address, currentChain } = useSDK();Pool Creation
Fetching Assets
Last updated