@chainpatrol/sdk 0.2.1 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { AssetCheckInput, AssetCheckOutput, AssetListInput, AssetListOutput, ReportCreateInput } from '@chainpatrol/validation';
2
+
1
3
  declare const ContinueAtOwnRisk = "CHAINPATROL_CONTINUE_AT_OWN_RISK";
2
4
  declare const IgnorelistUpdated = "CHAINPATROL_IGNORELIST_UPDATED";
3
5
  declare const CloseCurrentTab = "CHAINPATROL_CLOSE_CURRENT_TAB";
@@ -54,90 +56,18 @@ declare class ChainPatrolClient {
54
56
  constructor(options: ChainPatrolClientOptions);
55
57
  private fetch;
56
58
  get asset(): {
57
- check: (req: {
58
- type: AssetType;
59
- content: string;
60
- }) => Promise<{
61
- /**
62
- * "ALLOWED" - the asset is on the allowlist
63
- * "BLOCKED" - the asset is on the blocklist
64
- * "UNKNOWN" - the asset's status is not known
65
- */
66
- status: AssetStatus;
67
- /**
68
- * If the asset is allowed or blocked, this will be the reason why.
69
- * ChainPatrol aggregates data from multiple sources, so this will
70
- * tell you which source blocked or allowed the asset.
71
- *
72
- * ex. 'eth-phishing-detect' - the asset is on MetaMask's blocklist
73
- * 'reported' - the asset is on ChainPatrol's blocklist because
74
- * it was reported by a user
75
- */
76
- reason?: string;
77
- }>;
78
- list: (req: {
79
- /**
80
- * Asset type
81
- */
82
- type: AssetType;
83
- /**
84
- * Status of the assets to retrieve
85
- */
86
- status: AssetStatus;
87
- /**
88
- * The start date to list assets from. This should be in the format `YYYY-MM-DD` and is inclusive.
89
- */
90
- startDate?: string;
91
- /**
92
- * The end date to list assets from. This should be in the format `YYYY-MM-DD` and is inclusive.
93
- */
94
- endDate?: string;
95
- }) => Promise<{
96
- content: string;
97
- type: AssetType;
98
- status: AssetStatus;
99
- }[]>;
59
+ check: (req: AssetCheckInput) => Promise<AssetCheckOutput>;
60
+ list: (req: AssetListInput) => Promise<AssetListOutput>;
100
61
  };
101
62
  get report(): {
102
- create: (req: {
103
- /** Report title */
104
- title: string;
105
- /** Report description */
106
- description: string;
107
- /** List of assets to report with the proposed status */
108
- assets: {
109
- content: string;
110
- status: AssetStatus;
111
- }[];
112
- /** Organization slug (provide this or `discordGuildId`) */
113
- organizationSlug?: string;
114
- /** Discord guild ID (provide this or `organizationSlug`) */
115
- discordGuildId?: string;
116
- /** Optional raw input of the assets */
117
- rawAssetsInput?: string;
118
- /** Optional List of URLs of images to attach to the report */
119
- attachmentUrls?: string[];
120
- /** Optional contact information of the reporter */
121
- contactInfo?: string;
122
- /** Optional ID of the reporter if they are a member on ChainPatrol */
123
- reporterId?: number;
124
- /**
125
- * Optional information about the reporter if they are reporting from
126
- * a platform other than ChainPatrol
127
- */
128
- externalReporter?: {
129
- platform: string;
130
- platformIdentifier: string;
131
- avatarUrl?: string;
132
- };
133
- }) => Promise<{
63
+ create: (req: ReportCreateInput) => Promise<{
134
64
  id: number;
135
- createdAt: string;
65
+ createdAt: Date;
136
66
  organization: {
137
- id: number;
138
67
  slug: string;
139
68
  name: string;
140
- };
69
+ id: number;
70
+ } | null;
141
71
  }>;
142
72
  };
143
73
  }