diff --git a/src/fireblocks-sdk.ts b/src/fireblocks-sdk.ts index 58ac1c93..8385833e 100644 --- a/src/fireblocks-sdk.ts +++ b/src/fireblocks-sdk.ts @@ -48,6 +48,8 @@ import { WalletContainerResponse, SetFeePayerConfiguration, FeePayerConfiguration, + TimePeriod, + AuditsResponse, } from "./types"; export * from "./types"; @@ -1049,4 +1051,16 @@ export class FireblocksSDK { public async removeFeePayerConfiguration(baseAsset: string): Promise { return await this.apiClient.issueDeleteRequest(`/v1/fee_payer/${baseAsset}`); } + + /** + * Gets all audits for selected time period + * @param timePeriod + */ + public async getAudits(timePeriod?: TimePeriod): Promise { + let url = `/v1/audits`; + if (timePeriod) { + url += `?timePeriod=${timePeriod}`; + } + return await this.apiClient.issueGetRequest(url); + } } diff --git a/src/types.ts b/src/types.ts index 87839611..29d7491e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -703,3 +703,80 @@ export interface SetFeePayerConfiguration { export interface FeePayerConfiguration { feePayerAccountId: string; } + +export enum TimePeriod { + DAY = "DAY", + WEEK = "WEEK" +} + +export interface Audit { + data?: any; + vendorId?: string; + tenantId?: string; + severity?: string; + createdAt?: string; + subject?: string; + event?: string; + user?: string; + email?: string; + txId?: string; + amount?: string; + transactionId?: string; + walletType?: string; + walletName?: string; + confirmationThreshold?: string; + sourceType?: string; + sourceName?: string; + sourceId?: string; + destination?: string; + destAddress?: string; + newNote?: string; + remoteType?: string; + destName?: string; + remoteId?: string; + note?: string; + signedBy?: string; + approvedBy?: string; + setBy?: string; + cancelType?: string; + fee?: string; + rule?: string; + screeningStatus?: string; + verdict?: string; + bypassReason?: string; + status?: string; + subStatus?: string; + ruleJsonStr?: string; + rejectedReason?: string; + failReason?: string; + oldRole?: string; + role?: string; + subjectUser?: string; + ip?: string; + accountName?: string; + tag?: string; + address?: string; + accountType?: string; + counterpartyName?: string; + initiatedBy?: string; + asset?: string; + newIpAddress?: string; + approverList?: string; + removedUserName?: string; + removedUserEmail?: string; + action?: string; + description?: string; + userAgent?: string; + authorizationInfo?: string; + reEnrolledUser?: string; + oldThreshold?: string; + newThreshold?: string; + oldAmount?: string; + newAmount?: string; + draftPolicyJson?: string; +} + +export interface AuditsResponse { + data: Audit[]; + total: number; +} \ No newline at end of file