/** * @prettier */ import { BitGo } from '../bitgo'; import * as Bluebird from 'bluebird'; import { NodeCallback } from './types'; import { Wallet } from './wallet'; import { BaseCoin } from './baseCoin'; export interface PendingApprovalInfo { type: Type; transactionRequest?: { coinSpecific: { [key: string]: any; }; recipients: any; buildParams: { type?: 'fanout' | 'consolidate'; [index: string]: any; }; sourceWallet?: string; }; } export interface PendingApprovalData { id: string; wallet?: string; enterprise?: string; state: State; creator: string; info: PendingApprovalInfo; approvalsRequired?: number; } export declare enum OwnerType { WALLET = "wallet", ENTERPRISE = "enterprise" } export declare enum State { PENDING = "pending", AWAITING_SIGNATURE = "awaitingSignature", PENDING_BITGO_ADMIN_APPROVAL = "pendingBitGoAdminApproval", PENDING_ID_VERIFICATION = "pendingIdVerification", PENDING_CUSTODIAN_APPROVAL = "pendingCustodianApproval", PENDING_FINAL_APPROVAL = "pendingFinalApproval", APPROVED = "approved", PROCESSING = "processing", REJECTED = "rejected" } export declare enum Type { USER_CHANGE_REQUEST = "userChangeRequest", TRANSACTION_REQUEST = "transactionRequest", POLICY_RULE_REQUEST = "policyRuleRequest", UPDATE_APPROVALS_REQUIRED_REQUEST = "updateApprovalsRequiredRequest" } export interface ApproveOptions { walletPassphrase?: string; otp?: string; tx?: string; xprv?: string; } export declare class PendingApproval { private readonly bitgo; private readonly baseCoin; private wallet?; private _pendingApproval; constructor(bitgo: BitGo, baseCoin: BaseCoin, pendingApprovalData: PendingApprovalData, wallet?: Wallet); /** * Get the id for this PendingApproval */ id(): string; /** * Get the owner type (wallet or enterprise) * Pending approvals can be approved or modified by different scopes (depending on how they were created) * If a pending approval is owned by a wallet, then it can be approved by administrators of the wallet * If a pending approval is owned by an enterprise, then it can be approved by administrators of the enterprise */ ownerType(): OwnerType; /** * Get the id of the wallet which is associated with this PendingApproval */ walletId(): string | undefined; /** * Get the enterprise ID that is associated with this PendingApproval */ enterpriseId(): string | undefined; /** * Get the state of this PendingApproval */ state(): State; /** * Get the id of the user that performed the action resulting in this PendingApproval */ creator(): string; /** * Get the type of the pending approval (what it approves) */ type(): Type; /** * Get information about this PendingApproval */ info(): PendingApprovalInfo; /** * Get the number of approvals that are required for this PendingApproval to be approved. * Defaults to 1 if approvalsRequired doesn't exist on the object */ approvalsRequired(): number; /** * Generate a url for this PendingApproval for making requests to the server. * @param extra */ url(extra?: string): string; /** * Refetches this PendingApproval from the server and returns it. * * Note that this mutates the PendingApproval object in place. * @param params * @param callback */ get(params?: Record, callback?: NodeCallback): Bluebird; /** * Helper function to ensure that self.wallet is set */ private populateWallet; /** * Sets this PendingApproval to an approved state */ approve(params?: ApproveOptions, callback?: NodeCallback): Bluebird; /** * Sets this PendingApproval to a rejected state * @param params * @param callback */ reject(params?: Record, callback?: NodeCallback): Bluebird; /** * Alias for PendingApproval.reject() * * @deprecated * @param params * @param callback */ cancel(params?: Record, callback?: NodeCallback): Bluebird; /** * Recreate a transaction for a pending approval to respond to updated network conditions * @param params * @param callback */ recreateAndSignTransaction(params?: any, callback?: NodeCallback): Bluebird; } //# sourceMappingURL=pendingApproval.d.ts.map