File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/contracts-sdk/src/lib Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -606,13 +606,26 @@ export class LitContracts {
606606 this . connected = true ;
607607 } ;
608608
609+ /**
610+ * Retrieves the Staking contract instance based on the provided network, context, and RPC URL.
611+ * If a context is provided, it determines if a contract resolver is used for bootstrapping contracts.
612+ * If a resolver address is present in the context, it retrieves the Staking contract from the contract resolver instance.
613+ * Otherwise, it retrieves the Staking contract using the contract address and ABI from the contract context.
614+ * Throws an error if required contract data is missing or if the Staking contract cannot be obtained.
615+ *
616+ * @param network - The network key.
617+ * @param context - The contract context or contract resolver context.
618+ * @param rpcUrl - The RPC URL.
619+ * @returns The Staking contract instance.
620+ * @throws Error if required contract data is missing or if the Staking contract cannot be obtained.
621+ */
609622 public static async getStakingContract (
610623 network : LIT_NETWORKS_KEYS ,
611624 context ?: LitContractContext | LitContractResolverContext ,
612625 rpcUrl ?: string
613626 ) {
614627 let provider : ethers . providers . StaticJsonRpcProvider ;
615- rpcUrl = RPC_URL_BY_NETWORK [ network ] ;
628+ rpcUrl = rpcUrl || RPC_URL_BY_NETWORK [ network ] ;
616629 if ( context && 'provider' in context ! ) {
617630 provider = context . provider ;
618631 } else {
You can’t perform that action at this time.
0 commit comments