@rlajous/sdk-threat 1.0.0

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.
Files changed (113) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +288 -0
  3. package/dist/cjs/client.js +165 -0
  4. package/dist/cjs/client.js.map +1 -0
  5. package/dist/cjs/index.js +33 -0
  6. package/dist/cjs/index.js.map +1 -0
  7. package/dist/cjs/package.json +1 -0
  8. package/dist/cjs/resources/account-trace.js +96 -0
  9. package/dist/cjs/resources/account-trace.js.map +1 -0
  10. package/dist/cjs/resources/addresses.js +189 -0
  11. package/dist/cjs/resources/addresses.js.map +1 -0
  12. package/dist/cjs/resources/contracts.js +216 -0
  13. package/dist/cjs/resources/contracts.js.map +1 -0
  14. package/dist/cjs/resources/index.js +18 -0
  15. package/dist/cjs/resources/index.js.map +1 -0
  16. package/dist/cjs/resources/ledger.js +123 -0
  17. package/dist/cjs/resources/ledger.js.map +1 -0
  18. package/dist/cjs/resources/url.js +85 -0
  19. package/dist/cjs/resources/url.js.map +1 -0
  20. package/dist/cjs/resources/usage.js +124 -0
  21. package/dist/cjs/resources/usage.js.map +1 -0
  22. package/dist/cjs/resources/wallets.js +149 -0
  23. package/dist/cjs/resources/wallets.js.map +1 -0
  24. package/dist/cjs/types/account-trace.js +3 -0
  25. package/dist/cjs/types/account-trace.js.map +1 -0
  26. package/dist/cjs/types/address.js +3 -0
  27. package/dist/cjs/types/address.js.map +1 -0
  28. package/dist/cjs/types/contract.js +3 -0
  29. package/dist/cjs/types/contract.js.map +1 -0
  30. package/dist/cjs/types/index.js +3 -0
  31. package/dist/cjs/types/index.js.map +1 -0
  32. package/dist/cjs/types/ledger.js +3 -0
  33. package/dist/cjs/types/ledger.js.map +1 -0
  34. package/dist/cjs/types/url.js +3 -0
  35. package/dist/cjs/types/url.js.map +1 -0
  36. package/dist/cjs/types/usage.js +3 -0
  37. package/dist/cjs/types/usage.js.map +1 -0
  38. package/dist/cjs/types/wallet.js +3 -0
  39. package/dist/cjs/types/wallet.js.map +1 -0
  40. package/dist/esm/client.js +161 -0
  41. package/dist/esm/client.js.map +1 -0
  42. package/dist/esm/index.js +7 -0
  43. package/dist/esm/index.js.map +1 -0
  44. package/dist/esm/package.json +1 -0
  45. package/dist/esm/resources/account-trace.js +92 -0
  46. package/dist/esm/resources/account-trace.js.map +1 -0
  47. package/dist/esm/resources/addresses.js +185 -0
  48. package/dist/esm/resources/addresses.js.map +1 -0
  49. package/dist/esm/resources/contracts.js +212 -0
  50. package/dist/esm/resources/contracts.js.map +1 -0
  51. package/dist/esm/resources/index.js +8 -0
  52. package/dist/esm/resources/index.js.map +1 -0
  53. package/dist/esm/resources/ledger.js +119 -0
  54. package/dist/esm/resources/ledger.js.map +1 -0
  55. package/dist/esm/resources/url.js +81 -0
  56. package/dist/esm/resources/url.js.map +1 -0
  57. package/dist/esm/resources/usage.js +120 -0
  58. package/dist/esm/resources/usage.js.map +1 -0
  59. package/dist/esm/resources/wallets.js +145 -0
  60. package/dist/esm/resources/wallets.js.map +1 -0
  61. package/dist/esm/types/account-trace.js +2 -0
  62. package/dist/esm/types/account-trace.js.map +1 -0
  63. package/dist/esm/types/address.js +2 -0
  64. package/dist/esm/types/address.js.map +1 -0
  65. package/dist/esm/types/contract.js +2 -0
  66. package/dist/esm/types/contract.js.map +1 -0
  67. package/dist/esm/types/index.js +2 -0
  68. package/dist/esm/types/index.js.map +1 -0
  69. package/dist/esm/types/ledger.js +2 -0
  70. package/dist/esm/types/ledger.js.map +1 -0
  71. package/dist/esm/types/url.js +2 -0
  72. package/dist/esm/types/url.js.map +1 -0
  73. package/dist/esm/types/usage.js +2 -0
  74. package/dist/esm/types/usage.js.map +1 -0
  75. package/dist/esm/types/wallet.js +2 -0
  76. package/dist/esm/types/wallet.js.map +1 -0
  77. package/dist/types/client.d.ts +145 -0
  78. package/dist/types/client.d.ts.map +1 -0
  79. package/dist/types/index.d.ts +5 -0
  80. package/dist/types/index.d.ts.map +1 -0
  81. package/dist/types/resources/account-trace.d.ts +67 -0
  82. package/dist/types/resources/account-trace.d.ts.map +1 -0
  83. package/dist/types/resources/addresses.d.ts +131 -0
  84. package/dist/types/resources/addresses.d.ts.map +1 -0
  85. package/dist/types/resources/contracts.d.ts +156 -0
  86. package/dist/types/resources/contracts.d.ts.map +1 -0
  87. package/dist/types/resources/index.d.ts +8 -0
  88. package/dist/types/resources/index.d.ts.map +1 -0
  89. package/dist/types/resources/ledger.d.ts +107 -0
  90. package/dist/types/resources/ledger.d.ts.map +1 -0
  91. package/dist/types/resources/url.d.ts +69 -0
  92. package/dist/types/resources/url.d.ts.map +1 -0
  93. package/dist/types/resources/usage.d.ts +99 -0
  94. package/dist/types/resources/usage.d.ts.map +1 -0
  95. package/dist/types/resources/wallets.d.ts +106 -0
  96. package/dist/types/resources/wallets.d.ts.map +1 -0
  97. package/dist/types/types/account-trace.d.ts +68 -0
  98. package/dist/types/types/account-trace.d.ts.map +1 -0
  99. package/dist/types/types/address.d.ts +266 -0
  100. package/dist/types/types/address.d.ts.map +1 -0
  101. package/dist/types/types/contract.d.ts +169 -0
  102. package/dist/types/types/contract.d.ts.map +1 -0
  103. package/dist/types/types/index.d.ts +8 -0
  104. package/dist/types/types/index.d.ts.map +1 -0
  105. package/dist/types/types/ledger.d.ts +106 -0
  106. package/dist/types/types/ledger.d.ts.map +1 -0
  107. package/dist/types/types/url.d.ts +39 -0
  108. package/dist/types/types/url.d.ts.map +1 -0
  109. package/dist/types/types/usage.d.ts +74 -0
  110. package/dist/types/types/usage.d.ts.map +1 -0
  111. package/dist/types/types/wallet.d.ts +129 -0
  112. package/dist/types/types/wallet.d.ts.map +1 -0
  113. package/package.json +74 -0
@@ -0,0 +1,131 @@
1
+ import { HttpClient, Chain } from '@rlajous/sdk-core';
2
+ import { AddressRiskResponse, SanctionedResponse, PoisoningResponse, AddressAnalysisOptions, SanctionsOptions, PoisoningOptions } from '../types';
3
+ /**
4
+ * Resource for address risk analysis
5
+ *
6
+ * Provides comprehensive security analysis for blockchain addresses including:
7
+ * - Overall risk scoring
8
+ * - Risk categorization and tagging
9
+ * - Sanctions screening
10
+ * - Address poisoning detection
11
+ * - Fund flow analysis
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * // Analyze an address
16
+ * const risk = await client.addresses.analyze('0x...', { chain: Chain.ETH });
17
+ *
18
+ * // Check sanctions
19
+ * const sanctioned = await client.addresses.checkSanctioned('0x...', { chain: Chain.ETH });
20
+ *
21
+ * // With default chain configured, chain can be omitted
22
+ * const client = new ThreatClient({ apiKey: '...', defaultChain: Chain.ETH });
23
+ * const risk = await client.addresses.analyze('0x...'); // Uses ETH
24
+ * ```
25
+ */
26
+ export declare class AddressesResource {
27
+ private readonly httpClient;
28
+ private readonly defaultChain?;
29
+ constructor(httpClient: HttpClient, defaultChain?: Chain | undefined);
30
+ /**
31
+ * Resolve the chain to use for a request
32
+ * @throws ValidationError if no chain is specified and no default is set
33
+ */
34
+ private resolveChain;
35
+ /**
36
+ * Validate address format for the given chain
37
+ * @throws ValidationError if address format is invalid for the chain
38
+ */
39
+ private validateAddress;
40
+ /**
41
+ * Analyze an address for security risks
42
+ *
43
+ * Returns comprehensive risk analysis including:
44
+ * - Overall risk score (0-100)
45
+ * - Risk tags and categories
46
+ * - Detailed analysis data (optional)
47
+ * - Deployer risk for contracts (optional)
48
+ *
49
+ * @param address - Address to analyze
50
+ * @param options - Analysis options (chain is optional if defaultChain is set)
51
+ * @returns Address risk analysis result
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * // Basic analysis
56
+ * const risk = await client.addresses.analyze('0x742d35Cc...', {
57
+ * chain: Chain.ETH,
58
+ * });
59
+ * console.log(`Risk score: ${risk.overallRisk}`);
60
+ *
61
+ * // With default chain, options can be omitted
62
+ * const risk = await client.addresses.analyze('0x742d35Cc...');
63
+ *
64
+ * // With specific modules
65
+ * const risk = await client.addresses.analyze('0x...', {
66
+ * chain: Chain.ETH,
67
+ * modules: [RiskModule.SANCTIONS_COMPLIANCE, RiskModule.FUND_FLOW_SCREENING],
68
+ * });
69
+ *
70
+ * // With detailed response and deployer risk
71
+ * const risk = await client.addresses.analyze('0x...', {
72
+ * chain: Chain.ETH,
73
+ * detailed: true,
74
+ * deployerRisk: true,
75
+ * });
76
+ * ```
77
+ */
78
+ analyze(address: string, options?: AddressAnalysisOptions): Promise<AddressRiskResponse>;
79
+ /**
80
+ * Check if an address is sanctioned
81
+ *
82
+ * Screens the address against known sanctions lists including OFAC.
83
+ *
84
+ * @param address - Address to check
85
+ * @param options - Request options (chain is optional if defaultChain is set)
86
+ * @returns Sanctions check result
87
+ *
88
+ * @example
89
+ * ```typescript
90
+ * const result = await client.addresses.checkSanctioned('0x...', {
91
+ * chain: Chain.ETH,
92
+ * });
93
+ *
94
+ * // With default chain configured
95
+ * const result = await client.addresses.checkSanctioned('0x...');
96
+ *
97
+ * if (result.is_sanctioned) {
98
+ * console.error('Address is sanctioned!');
99
+ * console.log('Details:', result.sanction_details);
100
+ * }
101
+ * ```
102
+ */
103
+ checkSanctioned(address: string, options?: SanctionsOptions): Promise<SanctionedResponse>;
104
+ /**
105
+ * Check for address poisoning attacks
106
+ *
107
+ * Detects if an address has been targeted by address poisoning
108
+ * (dust attack) attempts.
109
+ *
110
+ * @param address - Address to check
111
+ * @param options - Request options (chain is optional if defaultChain is set)
112
+ * @returns Poisoning detection result
113
+ *
114
+ * @example
115
+ * ```typescript
116
+ * const result = await client.addresses.checkPoisoning('0x...', {
117
+ * chain: Chain.ETH,
118
+ * });
119
+ *
120
+ * // With default chain configured
121
+ * const result = await client.addresses.checkPoisoning('0x...');
122
+ *
123
+ * if (result.is_poisoned) {
124
+ * console.warn('Address poisoning detected!');
125
+ * console.log('Similar addresses:', result.poisoning_details?.similar_addresses);
126
+ * }
127
+ * ```
128
+ */
129
+ checkPoisoning(address: string, options?: PoisoningOptions): Promise<PoisoningResponse>;
130
+ }
131
+ //# sourceMappingURL=addresses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../src/resources/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKV,KAAK,EACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;gBADb,UAAU,EAAE,UAAU,EACtB,YAAY,CAAC,EAAE,KAAK,YAAA;IAGvC;;;OAGG;IACH,OAAO,CAAC,YAAY;IAUpB;;;OAGG;IACH,OAAO,CAAC,eAAe;IASvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACG,OAAO,CACX,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,mBAAmB,CAAC;IAgC/B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,eAAe,CACnB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,kBAAkB,CAAC;IAkB9B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,cAAc,CAClB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,iBAAiB,CAAC;CAiB9B"}
@@ -0,0 +1,156 @@
1
+ import { HttpClient, Chain } from '@rlajous/sdk-core';
2
+ import { ContractRiskResponse, ContractSourceCodeResponse, TokenTaxResponse, SolidityAnalysisRequest, SolidityAnalysisResponse, ContractAnalysisOptions, SourceCodeOptions, TaxOptions } from '../types';
3
+ /**
4
+ * Resource for smart contract security analysis
5
+ *
6
+ * Provides comprehensive contract analysis including:
7
+ * - Static and dynamic code analysis
8
+ * - Vulnerability detection
9
+ * - Source code verification
10
+ * - Tax/fee detection
11
+ * - Deployer risk analysis
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * // Analyze a contract
16
+ * const risk = await client.contracts.analyze('0x...', { chain: Chain.ETH });
17
+ *
18
+ * // Get source code
19
+ * const source = await client.contracts.getSourceCode('0x...', { chain: Chain.ETH });
20
+ *
21
+ * // With default chain configured, chain can be omitted
22
+ * const client = new ThreatClient({ apiKey: '...', defaultChain: Chain.ETH });
23
+ * const risk = await client.contracts.analyze('0x...'); // Uses ETH
24
+ * ```
25
+ */
26
+ export declare class ContractsResource {
27
+ private readonly httpClient;
28
+ private readonly defaultChain?;
29
+ constructor(httpClient: HttpClient, defaultChain?: Chain | undefined);
30
+ /**
31
+ * Resolve the chain to use for a request
32
+ * @throws ValidationError if no chain is specified and no default is set
33
+ */
34
+ private resolveChain;
35
+ /**
36
+ * Analyze a smart contract for security risks
37
+ *
38
+ * Returns comprehensive analysis including:
39
+ * - Risk score and categorization
40
+ * - Vulnerability detection
41
+ * - Source code analysis (if verified)
42
+ * - Similar contracts
43
+ * - Deployer risk (optional)
44
+ *
45
+ * @param address - Contract address
46
+ * @param options - Analysis options (chain is optional if defaultChain is set)
47
+ * @returns Contract risk analysis result
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * const result = await client.contracts.analyze('0xContract...', {
52
+ * chain: Chain.ETH,
53
+ * });
54
+ *
55
+ * // With default chain, options can be omitted
56
+ * const result = await client.contracts.analyze('0xContract...');
57
+ *
58
+ * console.log(`Risk score: ${result.score}`);
59
+ * console.log(`Tags: ${result.tags.map(t => t.name).join(', ')}`);
60
+ *
61
+ * // Check for vulnerabilities
62
+ * if (result.source_code_analysis && 'vulnerabilities' in result.source_code_analysis) {
63
+ * for (const vuln of result.source_code_analysis.vulnerabilities) {
64
+ * console.warn(`${vuln.severity}: ${vuln.title}`);
65
+ * }
66
+ * }
67
+ * ```
68
+ */
69
+ analyze(address: string, options?: ContractAnalysisOptions): Promise<ContractRiskResponse>;
70
+ /**
71
+ * Get contract source code
72
+ *
73
+ * Returns source code and metadata for verified contracts.
74
+ *
75
+ * @param address - Contract address
76
+ * @param options - Request options (chain is optional if defaultChain is set)
77
+ * @returns Contract source code and metadata
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * const source = await client.contracts.getSourceCode('0x...', {
82
+ * chain: Chain.ETH,
83
+ * });
84
+ *
85
+ * // With default chain configured
86
+ * const source = await client.contracts.getSourceCode('0x...');
87
+ *
88
+ * if (source.is_verified) {
89
+ * console.log(`Contract: ${source.contract_name}`);
90
+ * console.log(`Compiler: ${source.compiler_version}`);
91
+ * } else {
92
+ * console.log('Contract source not verified');
93
+ * }
94
+ * ```
95
+ */
96
+ getSourceCode(address: string, options?: SourceCodeOptions): Promise<ContractSourceCodeResponse>;
97
+ /**
98
+ * Get token buy/sell taxes
99
+ *
100
+ * Analyzes token contracts for buy and sell taxes.
101
+ *
102
+ * @param address - Token contract address
103
+ * @param options - Request options (chain is optional if defaultChain is set)
104
+ * @returns Tax information
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * const taxes = await client.contracts.getTaxes('0x...', {
109
+ * chain: Chain.ETH,
110
+ * });
111
+ *
112
+ * // With default chain configured
113
+ * const taxes = await client.contracts.getTaxes('0x...');
114
+ *
115
+ * if (taxes.buyTaxPercentage !== null || taxes.sellTaxPercentage !== null) {
116
+ * console.log(`Buy tax: ${taxes.buyTaxPercentage}%`);
117
+ * console.log(`Sell tax: ${taxes.sellTaxPercentage}%`);
118
+ * }
119
+ * ```
120
+ */
121
+ getTaxes(address: string, options?: TaxOptions): Promise<TokenTaxResponse>;
122
+ /**
123
+ * Analyze Solidity source code
124
+ *
125
+ * Analyzes raw Solidity source code for vulnerabilities
126
+ * without requiring deployment.
127
+ *
128
+ * @param request - Analysis request with source code
129
+ * @returns Analysis results
130
+ *
131
+ * @example
132
+ * ```typescript
133
+ * const result = await client.contracts.analyzeSolidity({
134
+ * source_code: `
135
+ * pragma solidity ^0.8.0;
136
+ * contract MyToken {
137
+ * // ...
138
+ * }
139
+ * `,
140
+ * compiler_version: '0.8.19',
141
+ * });
142
+ *
143
+ * if (result.success && result.results) {
144
+ * console.log(`Security score: ${result.results.security_score}`);
145
+ * for (const vuln of result.results.vulnerabilities) {
146
+ * console.warn(`${vuln.severity}: ${vuln.title}`);
147
+ * }
148
+ * }
149
+ * ```
150
+ */
151
+ analyzeSolidity(request: SolidityAnalysisRequest, options?: {
152
+ timeout?: number;
153
+ signal?: AbortSignal;
154
+ }): Promise<SolidityAnalysisResponse>;
155
+ }
156
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/resources/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKV,KAAK,EACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACX,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;gBADb,UAAU,EAAE,UAAU,EACtB,YAAY,CAAC,EAAE,KAAK,YAAA;IAGvC;;;OAGG;IACH,OAAO,CAAC,YAAY;IAUpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,OAAO,CACX,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,oBAAoB,CAAC;IA6BhC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,aAAa,CACjB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,0BAA0B,CAAC;IAyBtC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAyBpF;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,eAAe,CACnB,OAAO,EAAE,uBAAuB,EAChC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACnD,OAAO,CAAC,wBAAwB,CAAC;CAYrC"}
@@ -0,0 +1,8 @@
1
+ export { AddressesResource } from './addresses';
2
+ export { ContractsResource } from './contracts';
3
+ export { UrlResource } from './url';
4
+ export { WalletsResource } from './wallets';
5
+ export { LedgerResource } from './ledger';
6
+ export { AccountTraceResource } from './account-trace';
7
+ export { UsageResource } from './usage';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { HttpClient } from '@rlajous/sdk-core';
2
+ import { LedgerFamily, LedgerScanRequest, LedgerEIP712Request, LedgerScanResponse, LedgerScanOptions } from '../types';
3
+ /**
4
+ * Resource for hardware wallet transaction scanning
5
+ *
6
+ * Provides security analysis for transactions before signing on
7
+ * hardware wallets (Ledger devices).
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // Scan a transaction before signing
12
+ * const result = await client.ledger.scanTransaction('ethereum', {
13
+ * tx: { from: '0x...', raw: '0x...' },
14
+ * chain: 1,
15
+ * });
16
+ *
17
+ * if (!result.is_safe) {
18
+ * console.error('Transaction may be risky!');
19
+ * }
20
+ * ```
21
+ */
22
+ export declare class LedgerResource {
23
+ private readonly httpClient;
24
+ constructor(httpClient: HttpClient);
25
+ /**
26
+ * Scan a transaction before signing
27
+ *
28
+ * Analyzes a transaction for security risks before signing
29
+ * on a hardware wallet.
30
+ *
31
+ * @param family - Ledger device family (ethereum, solana, bitcoin)
32
+ * @param request - Transaction scan request
33
+ * @param options - Request options
34
+ * @returns Security analysis result
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * const result = await client.ledger.scanTransaction('ethereum', {
39
+ * tx: {
40
+ * from: '0xYourWallet...',
41
+ * raw: '0xEncodedTransaction...',
42
+ * },
43
+ * chain: 1, // Ethereum mainnet
44
+ * });
45
+ *
46
+ * if (!result.is_safe) {
47
+ * console.error(`Risk level: ${result.risk_level}`);
48
+ * for (const risk of result.risks) {
49
+ * console.warn(`${risk.level}: ${risk.description}`);
50
+ * }
51
+ * }
52
+ *
53
+ * // Check decoded data
54
+ * if (result.decoded?.function_name) {
55
+ * console.log(`Function: ${result.decoded.function_name}`);
56
+ * }
57
+ * ```
58
+ */
59
+ scanTransaction(family: LedgerFamily, request: LedgerScanRequest, options?: LedgerScanOptions): Promise<LedgerScanResponse>;
60
+ /**
61
+ * Scan EIP-712 typed data before signing
62
+ *
63
+ * Analyzes EIP-712 structured data for security risks
64
+ * before signing on a hardware wallet.
65
+ *
66
+ * @param family - Ledger device family
67
+ * @param request - EIP-712 scan request
68
+ * @param options - Request options
69
+ * @returns Security analysis result
70
+ *
71
+ * @example
72
+ * ```typescript
73
+ * const result = await client.ledger.scanEip712('ethereum', {
74
+ * signer: '0xYourWallet...',
75
+ * typedData: {
76
+ * domain: {
77
+ * name: 'MyDApp',
78
+ * version: '1',
79
+ * chainId: 1,
80
+ * verifyingContract: '0x...',
81
+ * },
82
+ * message: {
83
+ * // Message content
84
+ * },
85
+ * primaryType: 'Order',
86
+ * types: {
87
+ * EIP712Domain: [
88
+ * { name: 'name', type: 'string' },
89
+ * // ...
90
+ * ],
91
+ * Order: [
92
+ * { name: 'maker', type: 'address' },
93
+ * // ...
94
+ * ],
95
+ * },
96
+ * },
97
+ * chain: 1,
98
+ * });
99
+ *
100
+ * if (!result.is_safe) {
101
+ * console.error('EIP-712 data may be risky!');
102
+ * }
103
+ * ```
104
+ */
105
+ scanEip712(family: LedgerFamily, request: LedgerEIP712Request, options?: LedgerScanOptions): Promise<LedgerScanResponse>;
106
+ }
107
+ //# sourceMappingURL=ledger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../../src/resources/ledger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgB,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,eAAe,CACnB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;IAa9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACG,UAAU,CACd,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,kBAAkB,CAAC;CAY/B"}
@@ -0,0 +1,69 @@
1
+ import { HttpClient } from '@rlajous/sdk-core';
2
+ import { UrlRiskResponse, UrlAddResponse, UrlCheckOptions } from '../types';
3
+ /**
4
+ * Resource for URL safety analysis
5
+ *
6
+ * Provides URL risk assessment to identify phishing sites,
7
+ * malicious domains, and other web-based threats.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const result = await client.url.check('https://suspicious-site.com');
12
+ * if (result.prediction === 'malicious') {
13
+ * console.warn('URL is malicious!');
14
+ * }
15
+ * ```
16
+ */
17
+ export declare class UrlResource {
18
+ private readonly httpClient;
19
+ constructor(httpClient: HttpClient);
20
+ /**
21
+ * Check if a URL is safe
22
+ *
23
+ * Analyzes a URL for phishing, malware, and other threats.
24
+ *
25
+ * @param url - URL to check
26
+ * @param options - Request options
27
+ * @returns URL safety analysis result
28
+ *
29
+ * @example
30
+ * ```typescript
31
+ * const result = await client.url.check('https://example.com');
32
+ *
33
+ * if (result.prediction === 'malicious') {
34
+ * console.error('URL is potentially dangerous!');
35
+ * console.log('Details:', result.details);
36
+ * } else if (result.prediction === 'benign') {
37
+ * console.log('URL appears safe');
38
+ * }
39
+ *
40
+ * // Check blacklist/whitelist status
41
+ * if (result.blacklist === 'true') {
42
+ * console.error('URL is blacklisted');
43
+ * }
44
+ * if (result.whitelist === 'true') {
45
+ * console.log('URL is whitelisted');
46
+ * }
47
+ * ```
48
+ */
49
+ check(url: string, options?: UrlCheckOptions): Promise<UrlRiskResponse>;
50
+ /**
51
+ * Add a URL to the database
52
+ *
53
+ * Report a URL to be analyzed and added to the threat database.
54
+ *
55
+ * @param url - URL to add
56
+ * @param options - Request options
57
+ * @returns Addition result
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * const result = await client.url.add('https://phishing-site.com');
62
+ * if (result.success) {
63
+ * console.log('URL reported successfully');
64
+ * }
65
+ * ```
66
+ */
67
+ add(url: string, options?: UrlCheckOptions): Promise<UrlAddResponse>;
68
+ }
69
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/resources/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgB,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE5E;;;;;;;;;;;;;GAaG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAa7E;;;;;;;;;;;;;;;;OAgBG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;CAY3E"}
@@ -0,0 +1,99 @@
1
+ import { HttpClient } from '@rlajous/sdk-core';
2
+ import { UsageData, CurrentUsageResponse, UsagePlansResponse, UsageOptions } from '../types';
3
+ /**
4
+ * Resource for API usage and quota management
5
+ *
6
+ * Provides access to API usage statistics, current quota,
7
+ * and available plans.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const current = await client.usage.getCurrent();
12
+ * console.log(`Used: ${current.calls_used}/${current.calls_limit}`);
13
+ * ```
14
+ */
15
+ export declare class UsageResource {
16
+ private readonly httpClient;
17
+ constructor(httpClient: HttpClient);
18
+ /**
19
+ * Get historical usage data
20
+ *
21
+ * Returns API usage statistics for a time period.
22
+ *
23
+ * @param options - Request options with date range
24
+ * @returns Historical usage data
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * const usage = await client.usage.getUsage({
29
+ * start_date: '2024-01-01',
30
+ * end_date: '2024-01-31',
31
+ * });
32
+ *
33
+ * console.log(`Total calls: ${usage.total_calls}`);
34
+ * console.log(`Period calls: ${usage.period_calls}`);
35
+ *
36
+ * // Usage by endpoint
37
+ * if (usage.by_endpoint) {
38
+ * for (const [endpoint, count] of Object.entries(usage.by_endpoint)) {
39
+ * console.log(`${endpoint}: ${count} calls`);
40
+ * }
41
+ * }
42
+ * ```
43
+ */
44
+ getUsage(options?: UsageOptions): Promise<UsageData>;
45
+ /**
46
+ * Get current usage status
47
+ *
48
+ * Returns current period usage and remaining quota.
49
+ *
50
+ * @param options - Request options
51
+ * @returns Current usage status
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const current = await client.usage.getCurrent();
56
+ *
57
+ * console.log(`Plan: ${current.plan}`);
58
+ * console.log(`Used: ${current.calls_used}/${current.calls_limit}`);
59
+ * console.log(`Remaining: ${current.calls_remaining}`);
60
+ * console.log(`Usage: ${current.usage_percentage}%`);
61
+ * console.log(`Resets: ${current.reset_date}`);
62
+ *
63
+ * if (current.usage_percentage > 80) {
64
+ * console.warn('Approaching usage limit!');
65
+ * }
66
+ * ```
67
+ */
68
+ getCurrent(options?: {
69
+ timeout?: number;
70
+ signal?: AbortSignal;
71
+ }): Promise<CurrentUsageResponse>;
72
+ /**
73
+ * Get available usage plans
74
+ *
75
+ * Returns list of available plans and their features.
76
+ *
77
+ * @param options - Request options
78
+ * @returns Available plans
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * const plans = await client.usage.getPlans();
83
+ *
84
+ * console.log(`Current plan: ${plans.current_plan}`);
85
+ *
86
+ * for (const plan of plans.plans) {
87
+ * console.log(`${plan.name}:`);
88
+ * console.log(` Monthly limit: ${plan.monthly_limit}`);
89
+ * console.log(` Rate limit: ${plan.rate_limit}/sec`);
90
+ * console.log(` Features: ${plan.features.join(', ')}`);
91
+ * }
92
+ * ```
93
+ */
94
+ getPlans(options?: {
95
+ timeout?: number;
96
+ signal?: AbortSignal;
97
+ }): Promise<UsagePlansResponse>;
98
+ }
99
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/resources/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAgB,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7F;;;;;;;;;;;GAWG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAEnD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC;IAqB1D;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,UAAU,CAAC,OAAO,CAAC,EAAE;QACzB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAYjC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,QAAQ,CAAC,OAAO,CAAC,EAAE;QACvB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAWhC"}