import { Observer } from "./base.js"; import { Account, IdentityType, IntentResponseIdToken } from "./clients/intent.gen.js"; import { Store } from "./store.js"; import { SendContractCallArgs, SendERC1155Args, SendERC20Args, SendERC721Args, SendTransactionsArgs, SignMessageArgs, SignTypedDataArgs } from "./intents/index.js"; import { FeeOptionsResponse, MaySentTransactionResponse, SignedMessageResponse, SignedTypedDataResponse } from "./intents/responses.js"; import { Chain, Session } from "./clients/authenticator.gen.js"; import { SimpleNetwork, WithSimpleNetwork } from "./networks.js"; import { SubtleCryptoBackend } from "./subtle-crypto.js"; import { SecureStoreBackend } from "./secure-store.js"; import { Challenge } from "./challenge.js"; export type Sessions = (Session & { isThis: boolean; })[]; export type { Account }; export { IdentityType }; export type SequenceConfig = { projectAccessKey: string; waasConfigKey: string; network?: SimpleNetwork; disableHttpSignatureCheck?: boolean; }; export type ExtendedSequenceConfig = { rpcServer: string; emailRegion?: string; }; export type WaaSConfigKey = { projectId: number; emailClientId?: string; }; export type GuestIdentity = { guest: true; }; export type IdTokenIdentity = { idToken: string; }; export type EmailIdentity = { email: string; }; export type PlayFabIdentity = { playFabTitleId: string; playFabSessionTicket: string; }; export type XAuthIdentity = { xAccessToken: string; }; export type Identity = IdTokenIdentity | EmailIdentity | PlayFabIdentity | GuestIdentity | XAuthIdentity; export type SignInResponse = { sessionId: string; wallet: string; email?: string; }; export type ValidationArgs = { onValidationRequired?: () => boolean; }; export type CommonAuthArgs = { validation?: ValidationArgs; identifier?: string; }; export type Network = Chain; export type NetworkList = Network[]; export type EmailConflictInfo = { type: IdentityType; email: string; issuer: string; }; export declare function parseSequenceWaaSConfigKey(key: string): Partial; export declare function defaultArgsOrFail(config: SequenceConfig & Partial): Required & Required & ExtendedSequenceConfig; export declare class SequenceWaaS { private readonly store; private readonly cryptoBackend; private readonly secureStoreBackend; private waas; private client; private validationRequiredCallback; private emailConflictCallback; private emailAuthCodeRequiredCallback; private validationRequiredSalt; readonly config: Required & Required & ExtendedSequenceConfig; private readonly deviceName; private lastDate; private signatureVerificationFailed; constructor(config: SequenceConfig & Partial, store?: Store, cryptoBackend?: SubtleCryptoBackend | null, secureStoreBackend?: SecureStoreBackend | null); _fetch: (input: RequestInfo, init?: RequestInit) => Promise; onValidationRequired(callback: () => void): Promise<() => void>; onEmailConflict(callback: (info: EmailConflictInfo, forceCreate: () => Promise) => Promise): () => void; onEmailAuthCodeRequired(callback: (respondWithCode: (code: string) => Promise) => Promise): () => void; private handleValidationRequired; private headers; /** * Checks the server status and sets the time drift before sending any intent. * @throws {Error} If server status check fails or Date header is missing */ private preSendIntent; private sendIntent; isSignedIn(): Promise; signIn(creds: Identity, sessionName: string): Promise; initAuth(identity: Identity): Promise; private initGuestAuth; private initIdTokenAuth; private initEmailAuth; private initPlayFabAuth; private initXAuth; completeAuth(challenge: Challenge, opts?: { sessionName?: string; forceCreateAccount?: boolean; }): Promise; private registerSession; private refreshSession; getSessionId(): Promise; getSessionHash(): Promise; dropSession({ sessionId, strict }?: { sessionId?: string; strict?: boolean; }): Promise; listSessions(): Promise; getAddress(): Promise; validateSession(args?: ValidationArgs): Promise; finishValidateSession(challenge: string): Promise; isSessionValid(): Promise; waitForSessionValid(timeout?: number, pollRate?: number): Promise; sessionAuthProof({ nonce, network, validation }: { nonce?: string; network?: string; validation?: ValidationArgs; }): Promise; listAccounts(): Promise; linkAccount(challenge: Challenge): Promise; removeAccount(accountId: string): Promise; getIdToken(args?: { nonce?: string; }): Promise; useIdentifier(args: T): Promise; private trySendIntent; signMessage(args: WithSimpleNetwork & CommonAuthArgs): Promise; signTypedData(args: WithSimpleNetwork & CommonAuthArgs): Promise; private trySendTransactionIntent; sendTransaction(args: WithSimpleNetwork & CommonAuthArgs): Promise; sendERC20(args: WithSimpleNetwork & CommonAuthArgs): Promise; sendERC721(args: WithSimpleNetwork & CommonAuthArgs): Promise; sendERC1155(args: WithSimpleNetwork & CommonAuthArgs): Promise; callContract(args: WithSimpleNetwork & CommonAuthArgs): Promise; feeOptions(args: WithSimpleNetwork & CommonAuthArgs): Promise; networkList(): Promise; onSessionStateChanged(callback: Observer): () => void; fetch(input: RequestInfo, init?: RequestInit): Promise; }