import { Account } from "../account/index.js"; import { EphemeralKeyPair } from "../account/EphemeralKeyPair.js"; import { KeylessAccount } from "../account/KeylessAccount.js"; import { ProofFetchCallback } from "../account/AbstractKeylessAccount.js"; import { FederatedKeylessAccount } from "../account/FederatedKeylessAccount.js"; import { AccountAddressInput } from "../core/accountAddress.js"; import { ZeroKnowledgeSig } from "../core/crypto/keyless.js"; import { InputGenerateTransactionOptions, SimpleTransaction } from "../transactions/index.js"; import { HexInput } from "../types/index.js"; import { AptosConfig } from "./aptosConfig.js"; /** * A class to query all `Keyless` related queries on Aptos. * * More documentation on how to integrate Keyless Accounts see the below * [Aptos Keyless Integration Guide](https://aptos.dev/guides/keyless-accounts/#aptos-keyless-integration-guide). * @group Keyless */ export declare class Keyless { readonly config: AptosConfig; /** * Initializes a new instance of the Aptos class with the provided configuration. * This allows you to interact with the Aptos blockchain using the specified network settings. * * @param config - The configuration settings for connecting to the Aptos network. * * @example * ```typescript * import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk"; * * async function runExample() { * // Create a new configuration for the Aptos client * const config = new AptosConfig({ network: Network.TESTNET }); // Specify your desired network * * // Initialize the Aptos client with the configuration * const aptos = new Aptos(config); * * console.log("Aptos client initialized:", aptos); * } * runExample().catch(console.error); * ``` * @group Keyless */ constructor(config: AptosConfig); /** * Fetches the pepper from the Aptos pepper service API. * * @param args - The arguments for fetching the pepper. * @param args.jwt - JWT token. * @param args.ephemeralKeyPair - The EphemeralKeyPair used to generate the nonce in the JWT token. * @param args.derivationPath - A derivation path used for creating multiple accounts per user via the BIP-44 standard. Defaults * to "m/44'/637'/0'/0'/0". * @returns The pepper which is a Uint8Array of length 31. * * @example * ```typescript * import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk"; * * const config = new AptosConfig({ network: Network.TESTNET }); * const aptos = new Aptos(config); * * async function runExample() { * const ephemeralKeyPair = new EphemeralKeyPair(); // create a new ephemeral key pair * const jwt = "your_jwt_token"; // replace with a real JWT token * * // Fetching the pepper using the provided JWT and ephemeral key pair * const pepper = await aptos.getPepper({ * jwt, * ephemeralKeyPair, * // derivationPath: "m/44'/637'/0'/0'/0" // specify your own if needed * }); * * console.log("Fetched pepper:", pepper); * } * runExample().catch(console.error); * ``` * @group Keyless */ getPepper(args: { jwt: string; ephemeralKeyPair: EphemeralKeyPair; derivationPath?: string; }): Promise; /** * Fetches a proof from the Aptos prover service API. * * @param args - The arguments for fetching the proof. * @param args.jwt - JWT token. * @param args.ephemeralKeyPair - The EphemeralKeyPair used to generate the nonce in the JWT token. * @param args.pepper - The pepper used for the account. If not provided, it will be fetched from the Aptos pepper service. * @param args.uidKey - A key in the JWT token to use to set the uidVal in the IdCommitment. * * @returns The proof which is represented by a ZeroKnowledgeSig. * * @example * ```typescript * import { Aptos, AptosConfig, Network, EphemeralKeyPair, getPepper } from "@aptos-labs/ts-sdk"; * * const config = new AptosConfig({ network: Network.TESTNET }); * const aptos = new Aptos(config); * * async function runExample() { * const jwt = "your_jwt_token"; // replace with a real JWT token * const ephemeralKeyPair = new EphemeralKeyPair(); // create a new ephemeral key pair * * // Fetch the proof using the getProof function * const proof = await aptos.getProof({ * jwt, * ephemeralKeyPair, * pepper: await getPepper({}), // fetch the pepper if not provided * uidKey: "sub", // specify the uid key * }); * * console.log("Fetched proof:", proof); * } * runExample().catch(console.error); * ``` * @group Keyless */ getProof(args: { jwt: string; ephemeralKeyPair: EphemeralKeyPair; pepper?: HexInput; uidKey?: string; }): Promise; deriveKeylessAccount(args: { jwt: string; ephemeralKeyPair: EphemeralKeyPair; uidKey?: string; pepper?: HexInput; proofFetchCallback?: ProofFetchCallback; }): Promise; deriveKeylessAccount(args: { jwt: string; ephemeralKeyPair: EphemeralKeyPair; jwkAddress: AccountAddressInput; uidKey?: string; pepper?: HexInput; proofFetchCallback?: ProofFetchCallback; }): Promise; /** * This installs a set of FederatedJWKs at an address for a given iss. * * It will fetch the JSON Web Keyset (JWK) set from the well-known endpoint and update the FederatedJWKs at the sender's address * to reflect it. * * @param args.sender The account that will install the JWKs * @param args.iss the iss claim of the federated OIDC provider. * @param args.jwksUrl the URL to find the corresponding JWKs. For supported IDP providers this parameter in not necessary. * * @returns The pending transaction that results from submission. * @group Keyless */ updateFederatedKeylessJwkSetTransaction(args: { sender: Account; iss: string; jwksUrl?: string; options?: InputGenerateTransactionOptions; }): Promise; } //# sourceMappingURL=keyless.d.ts.map