-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: PRO-2395 refactor types and optimise imports
- Loading branch information
1 parent
03d1f1d
commit 11fb2d7
Showing
7 changed files
with
84 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,32 @@ | ||
// DTO for receiving data in the POST request to create a sponsorship policy | ||
export interface SponsorshipPolicyDto { | ||
policyId: number; // ID of the policy | ||
id: number; // ID of the policy | ||
walletAddress: string; // The wallet address associated with the API key | ||
name: string; // Name of the sponsorship policy | ||
description: string; // Description of the sponsorship policy | ||
startDate?: string; // Optional start date for the policy | ||
endDate?: string; // Optional end date for the policy | ||
isPerpetual: boolean; // Flag to indicate if the policy is perpetual | ||
isPublic: boolean; // Flag to indicate if the policy is public | ||
isEnabled: boolean; // Flag to indicate if the policy is enabled | ||
isUniversal: boolean; // Flag to indicate if the policy is universal | ||
contractRestrictions?: string; // JSON string containing any contract-specific restrictions | ||
enabledChains?: number[]; // Array of enabled chain IDs | ||
limits: SponsorshipPolicyLimitDTO[]; // Array of limits associated with the policy | ||
isEnabled: boolean; // Flag to indicate if the policy is enabled/disabled | ||
isExpired: boolean; // Flag to indicate if the policy is expired | ||
isCurrent: boolean; // Flag to indicate if the policy is current | ||
isApplicable: boolean; // Flag to indicate if the policy is applicable | ||
} | ||
|
||
export interface SponsorshipPolicyActionDto { | ||
policyId: number; | ||
action: ActionType; | ||
} | ||
|
||
// DTO for sponsorship policy limits | ||
export interface SponsorshipPolicyLimitDTO { | ||
limitType: LimitType; // Type of limit (GLOBAL, PER_USER, PER_OPERATION) | ||
maxUsd?: number; // Optional maximum USD limit | ||
maxEth?: number; // Optional maximum ETH limit | ||
maxOperations?: number; // Optional maximum number of operations | ||
} | ||
|
||
// enum for LimitTypes | ||
export enum LimitType { | ||
GLOBAL = 'GLOBAL', | ||
PER_USER = 'PER_USER', | ||
PER_OPERATION = 'PER_OPERATION' | ||
isPerpetual: boolean; // Flag to indicate if the policy is perpetual | ||
startDate?: string; // Optional start date for the policy | ||
endDate?: string; // Optional end date for the policy | ||
globalMaximumApplicable: boolean; // Flag to indicate if the global maximum is applicable | ||
globalMaximumUsd?: number; // Optional global maximum USD limit | ||
globalMaximumNative?: number; // Optional global maximum native limit | ||
globalMaximumOpCount?: number; // Optional global maximum operation count | ||
perUserMaximumApplicable: boolean; // Flag to indicate if the per user maximum is applicable | ||
perUserMaximumUsd?: number; // Optional per user maximum USD limit | ||
perUserMaximumNative?: number; // Optional per user maximum native limit | ||
perUserMaximumOpCount?: number; // Optional per user maximum operation count | ||
perOpMaximumApplicable: boolean; // Flag to indicate if the per operation maximum is applicable | ||
perOpMaximumUsd?: number; // Optional per operation maximum USD limit | ||
perOpMaximumNative?: number; // Optional per operation maximum native limit | ||
addressAllowList?: string[]; // Optional array of allowed addresses | ||
addressBlockList?: string[]; // Optional array of blocked addresses | ||
isExpired: boolean; // Flag to indicate if the policy is expired | ||
isCurrent: boolean; // Flag to indicate if the policy is current | ||
isApplicable: boolean; // Flag to indicate if the policy is applicable | ||
createdAt: Date; // Date the policy was created | ||
updatedAt: Date; // Date the policy was last updated | ||
} | ||
|
||
export enum ActionType { | ||
CREATE = 'CREATE', | ||
UPDATE = 'UPDATE', | ||
DISABLE = 'DISABLE', | ||
ENABLE = 'ENABLE', | ||
DELETE = 'DELETE' | ||
} |