import { IRequestTracer } from '../../../api'; import { SerializedKeyPair } from 'openpgp'; import { KeychainsTriplet, IBaseCoin } from '../../baseCoin'; import { BitGoBase } from '../../bitgoBase'; import { Keychain } from '../../keychain'; import { IWallet } from '../../wallet'; import { MpcUtils } from '../mpcUtils'; import { CustomGShareGeneratingFunction, CustomRShareGeneratingFunction, ITssUtils, PrebuildTransactionWithIntentOptions, SignatureShareRecord, TSSParams, TxRequest, TxRequestVersion } from './baseTypes'; import { SignShare, YShare, GShare } from '../../../account-lib/mpc/tss/eddsa/types'; /** * BaseTssUtil class which different signature schemes have to extend */ export default class BaseTssUtils extends MpcUtils implements ITssUtils { private _wallet?; constructor(bitgo: BitGoBase, baseCoin: IBaseCoin, wallet?: IWallet); get wallet(): IWallet; createUserKeychain(userGpgKey: SerializedKeyPair, userKeyShare: KeyShare, backupKeyShare: KeyShare, bitgoKeychain: Keychain, passphrase: string, originalPasscodeEncryptionCode: string, recipientIndex?: number | undefined): Promise; createBackupKeychain(userGpgKey: SerializedKeyPair, userKeyShare: KeyShare, backupKeyShare: KeyShare, bitgoKeychain: Keychain, passphrase: string): Promise; createBitgoKeychain(userGpgKey: SerializedKeyPair, userKeyShare: KeyShare, backupKeyShare: KeyShare, enterprise: string): Promise; createKeychains(params: { passphrase: string; enterprise?: string | undefined; originalPasscodeEncryptionCode?: string | undefined; }): Promise; signTxRequest(params: TSSParams): Promise; signTxRequestForMessage(params: TSSParams): Promise; /** * Signs a transaction using TSS for EdDSA and through utilization of custom share generators * * @param {string | TxRequest} txRequest - transaction request with unsigned transaction * @param {CustomRShareGeneratingFunction} externalSignerRShareGenerator a function that creates R shares in the EdDSA TSS flow * @param {CustomGShareGeneratingFunction} externalSignerGShareGenerator a function that creates G shares in the EdDSA TSS flow * @returns {Promise} - a signed tx request */ signUsingExternalSigner(txRequest: string | TxRequest, externalSignerRShareGenerator: CustomRShareGeneratingFunction, externalSignerGShareGenerator: CustomGShareGeneratingFunction): Promise; /** * Create an R (User to BitGo) share from an unsigned transaction and private user signing material * * @param {TxRequest} txRequest - transaction request with unsigned transaction * @param {string} prv - user signing material * @returns {Promise<{ rShare: SignShare; signingKeyYShare: YShare }>} - R Share and the Signing Key's Y share to BitGo */ createRShareFromTxRequest(params: { txRequest: TxRequest; prv: string; }): Promise<{ rShare: SignShare; signingKeyYShare: YShare; }>; /** * Create a G (User to BitGo) share from an unsigned transaction and private user signing material * * @param {TxRequest} txRequest - transaction request with unsigned transaction * @param {string} prv - user signing material * @param {SignatureShareRecord} bitgoToUserRShare - BitGo to User R Share * @param {SignShare} userToBitgoRShare - User to BitGo R Share * @returns {Promise} - GShare from User to BitGo */ createGShareFromTxRequest(params: { txRequest: TxRequest; prv: string; bitgoToUserRShare: SignatureShareRecord; userToBitgoRShare: SignShare; }): Promise; /** * Builds a tx request from params and verify it * * @param {PrebuildTransactionWithIntentOptions} params - parameters to build the tx * @param {TxRequestVersion} apiVersion lite or full * @param {boolean} preview boolean indicating if this is to preview a tx request, which will not initiate policy checks or pending approvals * @returns {Promise} - a built tx request */ prebuildTxWithIntent(params: PrebuildTransactionWithIntentOptions, apiVersion?: TxRequestVersion, preview?: boolean): Promise; /** * Call delete signature shares for a txRequest, the endpoint delete the signatures and return them * * @param {string} txRequestId tx id reference to delete signature shares * @returns {SignatureShareRecord[]} */ deleteSignatureShares(txRequestId: string): Promise; /** * Initialize the send procedure once Bitgo has the User To Bitgo GShare * * @param {String} txRequestId - the txRequest Id * @returns {Promise} */ sendTxRequest(txRequestId: string): Promise; /** * Delete signature shares, get the tx request without them from the db and sign it to finally send it. * * Note : This can be performed in order to reach latest network conditions required on pending approval flow. * * @param {String} txRequestId - the txRequest Id to make the requests. * @param {String} decryptedPrv - decrypted prv to sign the tx request. * @param {RequestTracer} reqId id tracer. * @returns {Promise} */ recreateTxRequest(txRequestId: string, decryptedPrv: string, reqId: IRequestTracer): Promise; /** * Gets the latest Tx Request by id * * @param {String} txRequestId - the txRequest Id * @returns {Promise} */ getTxRequest(txRequestId: string): Promise; } //# sourceMappingURL=baseTSSUtils.d.ts.map