@spheron/protocol-sdk
Version:
Spheron Protocol SDK
40 lines • 1.63 kB
TypeScript
import { ethers } from 'ethers';
import { Lease, LeaseState, LeaseWithOrderDetails } from './types';
import { NetworkType, RpcUrls } from '@config/index';
import { type SmartWalletBundlerClient } from '@utils/smart-wallet';
export declare class LeaseModule {
private smartWalletBundlerClientPromise?;
private provider;
private orderModule;
private fizzModule;
private providerModule;
private leaseCloseTimeoutId;
private wallet;
private networkType;
private rpcUrls;
constructor(provider: ethers.Provider, wallet?: ethers.Wallet, networkType?: NetworkType, smartWalletBundlerClientPromise?: Promise<SmartWalletBundlerClient> | undefined, rpcUrls?: RpcUrls);
getLeaseDetails(leaseId: string): Promise<Lease>;
getLeaseIds(address: string): Promise<{
activeLeaseIds: string[];
allLeaseIds: string[];
terminatedLeaseIds: string[];
}>;
getLeasesByState(address: string, options?: {
state?: LeaseState;
page?: number;
pageSize?: number;
}): Promise<{
leases: LeaseWithOrderDetails[];
activeCount: number;
terminatedCount: number;
totalCount: number;
}>;
closeLease(leaseId: string): Promise<string | null>;
closeLeaseWithPaymaster(leaseId: string): Promise<string | null>;
listenToLeaseClosedEvent(onSuccessCallback: ({ leaseId, providerAddress, tenantAddress, }: {
leaseId: string;
providerAddress: string;
tenantAddress: string;
}) => void, onFailureCallback: () => void, timeout?: number): Promise<unknown>;
}
//# sourceMappingURL=index.d.ts.map