diff --git a/stablepay-sdk/src/core/Wallet.js b/stablepay-sdk/src/core/Wallet.js index 0c666ef..f4a410a 100644 --- a/stablepay-sdk/src/core/Wallet.js +++ b/stablepay-sdk/src/core/Wallet.js @@ -1,3 +1,6 @@ +import { createWalletClient, custom } from 'viem'; +import { mainnet, sepolia } from 'viem/chains'; + export class Wallet { constructor(chainId) { this.chainId = chainId; @@ -34,7 +37,11 @@ export class Wallet { 11155111: sepolia, // Add other chains as needed }; - return chains[chainId]; + const chain = chains[chainId]; + if (!chain) { + throw new Error(`Unsupported chainId: ${chainId}`); + } + return chain; } async disconnect() { @@ -49,4 +56,4 @@ export class Wallet { getAccount() { return this.account; } -} \ No newline at end of file +}