@roochnetwork/rooch-sdk
Version:
40 lines (39 loc) • 1.77 kB
TypeScript
import { RoochClient } from '../client/index.js';
import { Ed25519Keypair } from '../keypairs/index.js';
import { Transaction } from '../transactions/index.js';
import { BitcoinAddress, RoochAddress } from '../address/index.js';
import { Authenticator, PublicKey, SignatureScheme, Signer } from '../crypto/index.js';
import { CreateSessionArgs } from './types.js';
import { Bytes } from '../types/index.js';
type InnerCreateSessionArgs = {
client: RoochClient;
signer: Signer;
} & CreateSessionArgs;
export declare class Session extends Signer {
readonly appName: string;
readonly appUrl: string;
readonly scopes: string[];
readonly keypair: Ed25519Keypair;
readonly maxInactiveInterval: number;
readonly bitcoinAddress: BitcoinAddress;
readonly roochAddress: RoochAddress;
readonly localCreateSessionTime: number;
protected lastActiveTime: number;
protected constructor(appName: string, appUrl: string, scopes: string[], roochAddress: RoochAddress, bitcoinAddress: BitcoinAddress, keypair?: Ed25519Keypair, maxInactiveInterval?: number, localCreateSessionTime?: number, lastActiveTime?: number);
static CREATE(input: InnerCreateSessionArgs): Promise<Session>;
static fromJson(jsonObj: any): Session;
getLastActiveTime(): number;
isSessionExpired(): boolean;
sign(input: Bytes): Promise<Bytes>;
signTransaction(input: Transaction): Promise<Authenticator>;
getRoochAddress(): RoochAddress;
getBitcoinAddress(): BitcoinAddress;
getKeyScheme(): SignatureScheme;
getPublicKey(): PublicKey<RoochAddress>;
getCreateTime(): number;
getAuthKey(): string;
getScopes(): string[];
protected build(client: RoochClient, signer: Signer): Promise<this>;
toJSON(): any;
}
export {};