Types and interfaces
List of important types.
type SessionParameters = {
allowedMethods: Array<{
contract: string;
selector: string;
}>;
validityDays?: number;
};
type ConnectResponse = {
account: SessionAccountInterface;
initData?: InitDataParsed;
callbackData?: string;
};
interface SessionAccountInterface extends AccountInterface {
isDeployed(): Promise<boolean>;
getDeploymentPayload(): Promise<DeployAccountContractPayload>;
getOutsideExecutionPayload({ calls }: { calls: Call[] }): Promise<Call>;
getSessionStatus(): SessionStatus; // "VALID" | "EXPIRED" | "INVALID_SCOPE"
}
interface ArgentTMAInterface {
provider: ProviderInterface;
sessionAccount?: SessionAccountInterface;
connect(): Promise<ConnectResponse | undefined>;
requestConnection(callbackData: string): Promise<never>;
isConnected(): boolean;
exportSignedSession(): Promise<ArgentTMASession | undefined>;
clearSession(): Promise<void>;
}
type ArgentTMASession = {
version: number;
privateKey: string;
publicKey: string;
sessionInfo: OffChainSession;
deploymentPayload?: AccountDeploymentPayload;
signature?: Signature;
address?: string;
};
Last updated