UNPKG

stellar-plus

Version:

beta version of stellar-plus, an all-in-one sdk for the Stellar blockchain

59 lines (58 loc) 2.71 kB
import { FeeBumpTransaction, Transaction, xdr } from '@stellar/stellar-sdk'; import { DefaultAccountHandler, DefaultAccountHandlerPayload } from '../../../../stellar-plus/account/account-handler/default/types'; import { AccountBase } from '../../../../stellar-plus/account/base'; import { TransactionXdr } from '../../../../stellar-plus/types'; /** * @class DefaultAccountHandlerClient * @extends AccountBase * @implements DefaultAccountHandler * @description - The default account handler is used for handling and creating new accounts by directly manipulating the secret key. Avoid using this handler in production environments. */ export declare class DefaultAccountHandlerClient extends AccountBase implements DefaultAccountHandler { protected secretKey: string; /** * * @args payload - The payload for the account handler. Additional parameters may be provided to enable different helpers. * @param {string=} payload.secretKey The secret key of the account. If not provided, a new random account will be created. * @param {NetworkConfig} payload.networkConfig The network to use. * @description - The default account handler is used for handling and creating new accounts by directly manipulating the secret key. */ constructor(payload?: DefaultAccountHandlerPayload); /** * * @returns {string} The public key of the account. */ getPublicKey(): string; /** * @description - Returns the secret key of the account. * * @returns {string} The secret key of the account. */ getSecretKey(): string; /** * * @param {Transaction} tx - The transaction to sign. * * @description - Signs the given transaction with the account's secret key. * * @returns {TransactionXdr} The signed transaction in xdr format. */ sign(tx: Transaction | FeeBumpTransaction): TransactionXdr; /** * * @param {xdr.SorobanAuthorizationEntry} entry - The soroban authorization entry to sign. * @param {number} validUntilLedgerSeq - The ledger sequence number until which the entry signature is valid. * @param {string} networkPassphrase - The network passphrase. * * @description - Signs the given Soroban authorization entry with the account's secret key. * * @returns {xdr.SorobanAuthorizationEntry} The signed entry. */ signSorobanAuthEntry(entry: xdr.SorobanAuthorizationEntry, validUntilLedgerSeq: number, networkPassphrase: string): Promise<xdr.SorobanAuthorizationEntry>; /** * * @param {Buffer} data - The data to sign. * @returns {Buffer} The signature of the data. */ signData(data: Buffer): Buffer; }