@explorins/pers-sdk 1.1.0-beta.0 → 1.1.2

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 (76) hide show
  1. package/config/domains.js +22 -0
  2. package/package.json +100 -15
  3. package/rollup.config.js +44 -54
  4. package/scripts/copy-declarations.js +147 -0
  5. package/src/analytics/api/analytics-api.ts +24 -0
  6. package/src/analytics/index.ts +52 -0
  7. package/src/analytics/models/index.ts +74 -0
  8. package/src/analytics/services/analytics-service.ts +28 -0
  9. package/src/auth-admin/api/auth-admin-api.ts +42 -0
  10. package/src/auth-admin/index.ts +47 -0
  11. package/src/auth-admin/services/auth-admin-service.ts +36 -0
  12. package/src/business/api/business-api.ts +181 -19
  13. package/src/business/index.ts +4 -3
  14. package/src/business/models/index.ts +4 -4
  15. package/src/business/services/business-service.ts +1 -1
  16. package/src/campaign/api/campaign-api.ts +376 -0
  17. package/src/campaign/index.ts +67 -0
  18. package/src/campaign/services/campaign-service.ts +164 -0
  19. package/src/core/abstractions/http-client.ts +1 -0
  20. package/src/core/auth/auth-provider.interface.ts +2 -2
  21. package/src/core/auth/create-auth-provider.ts +6 -6
  22. package/src/core/index.ts +33 -0
  23. package/src/core/pers-api-client.ts +211 -19
  24. package/src/core/pers-config.ts +34 -7
  25. package/src/core/utils/jwt.function.ts +24 -0
  26. package/src/donation/api/donation-api.ts +24 -0
  27. package/src/donation/index.ts +47 -0
  28. package/src/donation/models/index.ts +11 -0
  29. package/src/donation/services/donation-service.ts +25 -0
  30. package/src/index.ts +40 -1
  31. package/src/payment/api/payment-api.ts +185 -0
  32. package/src/payment/index.ts +64 -0
  33. package/src/payment/models/index.ts +29 -0
  34. package/src/payment/services/payment-service.ts +70 -0
  35. package/src/redemption/api/redemption-api.ts +241 -0
  36. package/src/redemption/index.ts +60 -0
  37. package/src/redemption/models/index.ts +17 -0
  38. package/src/redemption/services/redemption-service.ts +103 -0
  39. package/src/shared/interfaces/pers-shared-lib.interfaces.ts +99 -0
  40. package/src/tenant/api/tenant-api.ts +92 -0
  41. package/src/tenant/index.ts +61 -0
  42. package/src/tenant/models/index.ts +20 -0
  43. package/src/tenant/services/tenant-service.ts +78 -0
  44. package/src/token/api/token-api.ts +129 -0
  45. package/src/token/base/base-token-service.ts +167 -0
  46. package/src/token/index.ts +38 -0
  47. package/src/token/models/index.ts +30 -0
  48. package/src/token/services/token-service.ts +125 -0
  49. package/src/token/token-sdk.ts +231 -0
  50. package/src/transaction/api/transaction-api.ts +296 -0
  51. package/src/transaction/index.ts +65 -0
  52. package/src/transaction/models/index.ts +60 -0
  53. package/src/transaction/services/transaction-service.ts +104 -0
  54. package/src/user/api/user-api.ts +98 -0
  55. package/src/user/index.ts +62 -0
  56. package/src/user/models/index.ts +10 -0
  57. package/src/user/services/user-service.ts +75 -0
  58. package/src/user-status/api/user-status-api.ts +78 -0
  59. package/src/user-status/index.ts +55 -0
  60. package/src/user-status/models/index.ts +11 -0
  61. package/src/user-status/services/user-status-service.ts +51 -0
  62. package/src/web3/api/web3-api.ts +68 -0
  63. package/src/web3/index.ts +38 -0
  64. package/src/web3/models/index.ts +150 -0
  65. package/src/web3/services/web3-service.ts +338 -0
  66. package/src/web3-chain/api/web3-chain-api.ts +42 -0
  67. package/src/web3-chain/index.ts +27 -0
  68. package/src/web3-chain/models/index.ts +45 -0
  69. package/src/web3-chain/services/getWeb3FCD.service.ts +47 -0
  70. package/src/web3-chain/services/provider.service.ts +123 -0
  71. package/src/web3-chain/services/public-http-provider.service.ts +26 -0
  72. package/src/web3-chain/services/web3-chain-service.ts +131 -0
  73. package/src/business/business/tsconfig.json +0 -18
  74. package/src/core/abstractions/core-interfaces.ts +0 -56
  75. package/src/core/core.ts +0 -30
  76. package/src/core.ts +0 -30
@@ -0,0 +1,167 @@
1
+ import { PersApiClient } from '../../core/pers-api-client';
2
+ import { TokenApi } from '../api/token-api';
3
+ import { TokenService as TokenBusinessService } from '../services/token-service';
4
+ import {
5
+ TokenDTO,
6
+ TokenStorageData,
7
+ TokenCreateRequestDTO,
8
+ TokenUpdateRequestDTO,
9
+ TokenMetadataDTO
10
+ } from '../models';
11
+ import { TokenTypeDTO } from '../../shared/interfaces/pers-shared-lib.interfaces';
12
+
13
+ /**
14
+ * Abstract Base Token Service - Explicit Initialization Pattern
15
+ *
16
+ * Platform-agnostic token operations with Promise-based API.
17
+ * Framework services extend this and control initialization lifecycle.
18
+ *
19
+ * Benefits:
20
+ * - Explicit initialization control
21
+ * - Better error boundaries
22
+ * - Clear lifecycle management
23
+ * - Testable initialization state
24
+ * - Zero framework dependencies
25
+ */
26
+ export abstract class BaseTokenService {
27
+ // Private token service layers - initialized explicitly
28
+ private _tokenApi?: TokenApi;
29
+ private _tokenBusinessService?: TokenBusinessService;
30
+ private _isInitialized = false;
31
+
32
+ // ==========================================
33
+ // INITIALIZATION LIFECYCLE
34
+ // ==========================================
35
+
36
+ /**
37
+ * LIFECYCLE: Initialize token service with API client
38
+ * Must be called before using any token operations
39
+ */
40
+ protected initializeTokenService(apiClient: PersApiClient): void {
41
+ if (!apiClient) {
42
+ throw new Error('Cannot initialize TokenService: apiClient is null or undefined');
43
+ }
44
+
45
+ if (!this._isInitialized) {
46
+ this._tokenApi = new TokenApi(apiClient);
47
+ this._tokenBusinessService = new TokenBusinessService(this._tokenApi);
48
+ this._isInitialized = true;
49
+ }
50
+ }
51
+
52
+ /**
53
+ * LIFECYCLE: Check if token service is initialized
54
+ */
55
+ protected get isTokenServiceInitialized(): boolean {
56
+ return this._isInitialized;
57
+ }
58
+
59
+ /**
60
+ * INTERNAL: Get token business service (throws if not initialized)
61
+ */
62
+ private get tokenBusinessService(): TokenBusinessService {
63
+ if (!this._tokenBusinessService) {
64
+ throw new Error('TokenService not initialized. Call initializeTokenService(apiClient) first.');
65
+ }
66
+ return this._tokenBusinessService;
67
+ }
68
+
69
+ // ==========================================
70
+ // PUBLIC OPERATIONS
71
+ // ==========================================
72
+
73
+ /**
74
+ * PUBLIC: Get all remote tokens
75
+ */
76
+ public getRemoteTokens(): Promise<TokenDTO[]> {
77
+ return this.tokenBusinessService.getRemoteTokens();
78
+ }
79
+
80
+ /**
81
+ * PUBLIC: Get all remote token types
82
+ */
83
+ public getRemoteTokenTypes(): Promise<TokenTypeDTO[]> {
84
+ return this.tokenBusinessService.getRemoteTokenTypes();
85
+ }
86
+
87
+ /**
88
+ * PUBLIC: Get active credit token
89
+ */
90
+ public getRemoteActiveCreditToken(): Promise<TokenDTO> {
91
+ return this.tokenBusinessService.getRemoteActiveCreditToken();
92
+ }
93
+
94
+ /**
95
+ * PUBLIC: Get reward tokens
96
+ */
97
+ public getRemoteRewardTokens(): Promise<TokenDTO[]> {
98
+ return this.tokenBusinessService.getRemoteRewardTokens();
99
+ }
100
+
101
+ /**
102
+ * PUBLIC: Get status tokens
103
+ */
104
+ public getRemoteStatusTokens(): Promise<TokenDTO[]> {
105
+ return this.tokenBusinessService.getRemoteStatusTokens();
106
+ }
107
+
108
+ /**
109
+ * PUBLIC: Get token by contract address
110
+ */
111
+ public getTokenByContractAddress(contractAddress: string, contractTokenId: string | null): Promise<TokenDTO> {
112
+ return this.tokenBusinessService.getTokenByContractAddress(contractAddress, contractTokenId);
113
+ }
114
+
115
+ // ==========================================
116
+ // ADMIN OPERATIONS
117
+ // ==========================================
118
+
119
+ /**
120
+ * ADMIN: Create token metadata
121
+ */
122
+ public createTokenMetadata(tokenId: string, tokenData: TokenStorageData): Promise<TokenDTO> {
123
+ return this.tokenBusinessService.createTokenMetadata(tokenId, tokenData);
124
+ }
125
+
126
+ /**
127
+ * ADMIN: Toggle token active status
128
+ */
129
+ public toggleTokenActive(tokenId: string): Promise<TokenDTO> {
130
+ return this.tokenBusinessService.toggleTokenActive(tokenId);
131
+ }
132
+
133
+ /**
134
+ * ADMIN: Create new token
135
+ */
136
+ public createToken(tokenData: TokenCreateRequestDTO): Promise<TokenDTO> {
137
+ return this.tokenBusinessService.createToken(tokenData);
138
+ }
139
+
140
+ /**
141
+ * ADMIN: Update token
142
+ */
143
+ public updateToken(tokenId: string, tokenData: TokenUpdateRequestDTO): Promise<TokenDTO> {
144
+ return this.tokenBusinessService.updateToken(tokenId, tokenData);
145
+ }
146
+
147
+ /**
148
+ * ADMIN: Set mainnet contract address
149
+ */
150
+ public setMainnetContract(tokenId: string, contractAddress: string, chainId: number): Promise<TokenDTO> {
151
+ return this.tokenBusinessService.setMainnetContract(tokenId, contractAddress, chainId);
152
+ }
153
+
154
+ /**
155
+ * ADMIN: Toggle token metadata status
156
+ */
157
+ public toggleTokenMetadataStatus(metadataId: string): Promise<TokenMetadataDTO> {
158
+ return this.tokenBusinessService.toggleTokenMetadataStatus(metadataId);
159
+ }
160
+
161
+ /**
162
+ * ADMIN: Create token type
163
+ */
164
+ public createTokenType(tokenType: TokenTypeDTO): Promise<TokenTypeDTO> {
165
+ return this.tokenBusinessService.createTokenType(tokenType);
166
+ }
167
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @explorins/pers-sdk-token
3
+ *
4
+ * Platform-agnostic Token Domain SDK for PERS ecosystem
5
+ * Modern class-based approach for optimal performance and developer experience
6
+ */
7
+
8
+ // 🚀 MAIN SDK EXPORT - Recommended approach
9
+ export { TokenSDK } from './token-sdk';
10
+
11
+ // 🔧 CORE COMPONENTS - For advanced usage
12
+ export { TokenApi } from './api/token-api';
13
+ export { TokenService } from './services/token-service';
14
+
15
+ // 📋 MODELS & TYPES
16
+ export * from './models';
17
+ export * from '../shared/interfaces/pers-shared-lib.interfaces';
18
+
19
+ // 🔄 LEGACY EXPORTS - For backward compatibility (deprecated)
20
+ export { BaseTokenService } from './base/base-token-service';
21
+ // Note: ConcreteTokenService has been replaced by TokenSDK class-based approach
22
+
23
+ // ==========================================
24
+ // INHERITANCE PATTERN - CLEAN ARCHITECTURE
25
+ // ==========================================
26
+ // Framework services extend TokenService directly:
27
+ //
28
+ // Example usage:
29
+ // export class TokenSdkApiService extends TokenService {
30
+ // private persSDK = inject(PERS_ANGULAR_SDK_SERVICE);
31
+ // protected get apiClient() { return this.persSDK.api(); }
32
+ // }
33
+ //
34
+ // Benefits:
35
+ // - Zero boilerplate: Just extend and provide apiClient
36
+ // - Type safety: Full IntelliSense support
37
+ // - Platform agnostic: SDK stays pure Promise-based
38
+ // - Framework flexibility: Add Observable wrappers as needed
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Token Domain Models
3
+ *
4
+ * Re-exports from @explorins/pers-shared for consistency with backend
5
+ * and to provide a single import source for token-related types.
6
+ */
7
+
8
+ // Core token entities from centralized pers-shared interfaces
9
+ export type {
10
+ TokenDTO,
11
+ TokenTypeDTO,
12
+ TokenCreateRequestDTO,
13
+ TokenUpdateRequestDTO,
14
+ TokenMetadataDTO,
15
+ TokenStorageData
16
+ } from '../../shared/interfaces/pers-shared-lib.interfaces';
17
+
18
+ // Local token interfaces
19
+ export interface TokenMetadataAttribute {
20
+ trait_type: TokenMetadataAttributeType;
21
+ value: string;
22
+ }
23
+
24
+ export type TokenMetadataAttributeType = 'expiry_date' | 'creator_account_address' | 'preview_url' | 'creatorAccountAddress'
25
+
26
+ export interface TokenAttribute {
27
+ trait_type: string;
28
+ value: string | number;
29
+ display_type?: string;
30
+ }
@@ -0,0 +1,125 @@
1
+ import { TokenApi } from '../api/token-api';
2
+ import {
3
+ TokenDTO,
4
+ TokenStorageData,
5
+ TokenCreateRequestDTO,
6
+ TokenUpdateRequestDTO,
7
+ TokenMetadataDTO
8
+ } from '../models';
9
+ import { TokenTypeDTO } from '../../shared/interfaces/pers-shared-lib.interfaces';
10
+
11
+ /**
12
+ * Platform-Agnostic Token Service
13
+ *
14
+ * Contains token business logic and operations that work across platforms.
15
+ * No framework dependencies - pure TypeScript business logic.
16
+ * Matches framework TokenApiService capabilities exactly.
17
+ */
18
+ export class TokenService {
19
+ constructor(private tokenApi: TokenApi) {}
20
+
21
+ // ==========================================
22
+ // PUBLIC OPERATIONS
23
+ // ==========================================
24
+
25
+ /**
26
+ * PUBLIC: Get all remote tokens
27
+ */
28
+ async getRemoteTokens(): Promise<TokenDTO[]> {
29
+ return this.tokenApi.getRemoteTokens();
30
+ }
31
+
32
+ /**
33
+ * PUBLIC: Get all remote token types
34
+ */
35
+ async getRemoteTokenTypes(): Promise<TokenTypeDTO[]> {
36
+ return this.tokenApi.getRemoteTokenTypes();
37
+ }
38
+
39
+ /**
40
+ * PUBLIC: Get active credit token
41
+ */
42
+ async getRemoteActiveCreditToken(): Promise<TokenDTO> {
43
+ return this.tokenApi.getRemoteActiveCreditToken();
44
+ }
45
+
46
+ /**
47
+ * PUBLIC: Get reward tokens
48
+ */
49
+ async getRemoteRewardTokens(): Promise<TokenDTO[]> {
50
+ return this.tokenApi.getRemoteRewardTokens();
51
+ }
52
+
53
+ /**
54
+ * PUBLIC: Get status tokens
55
+ */
56
+ async getRemoteStatusTokens(): Promise<TokenDTO[]> {
57
+ return this.tokenApi.getRemoteStatusTokens();
58
+ }
59
+
60
+ /**
61
+ * PUBLIC: Get token by contract address
62
+ * ✅ FIXED: Matches framework parameter types exactly
63
+ */
64
+ async getTokenByContractAddress(contractAddress: string, contractTokenId: string | null): Promise<TokenDTO> {
65
+ return this.tokenApi.getTokenByContractAddress(contractAddress, contractTokenId);
66
+ }
67
+
68
+ // ==========================================
69
+ // ADMIN OPERATIONS
70
+ // ==========================================
71
+
72
+ /**
73
+ * ADMIN: Create token metadata
74
+ */
75
+ async createTokenMetadata(tokenId: string, tokenData: TokenStorageData): Promise<TokenDTO> {
76
+ return this.tokenApi.createTokenMetadata(tokenId, tokenData);
77
+ }
78
+
79
+ /**
80
+ * ADMIN: Toggle token active status
81
+ */
82
+ async toggleTokenActive(tokenId: string): Promise<TokenDTO> {
83
+ return this.tokenApi.toggleTokenActive(tokenId);
84
+ }
85
+
86
+ /**
87
+ * ADMIN: Create new token
88
+ */
89
+ async createToken(tokenData: TokenCreateRequestDTO): Promise<TokenDTO> {
90
+ return this.tokenApi.createToken(tokenData);
91
+ }
92
+
93
+ /**
94
+ * ADMIN: Update token
95
+ */
96
+ async updateToken(tokenId: string, tokenData: TokenUpdateRequestDTO): Promise<TokenDTO> {
97
+ return this.tokenApi.updateToken(tokenId, tokenData);
98
+ }
99
+
100
+ /**
101
+ * ADMIN: Set mainnet contract address
102
+ */
103
+ async setMainnetContract(tokenId: string, contractAddress: string, chainId: number): Promise<TokenDTO> {
104
+ return this.tokenApi.setMainnetContract(tokenId, contractAddress, chainId);
105
+ }
106
+
107
+ /**
108
+ * ADMIN: Toggle token metadata status
109
+ */
110
+ async toggleTokenMetadataStatus(metadataId: string): Promise<TokenMetadataDTO> {
111
+ return this.tokenApi.toggleTokenMetadataStatus(metadataId);
112
+ }
113
+
114
+ /**
115
+ * ADMIN: Create token type
116
+ */
117
+ async createTokenType(tokenType: TokenTypeDTO): Promise<TokenTypeDTO> {
118
+ return this.tokenApi.createTokenType(tokenType);
119
+ }
120
+
121
+ // ❌ REMOVED: Business logic methods not present in framework
122
+ // - validateTokenMetadata() - Framework doesn't need this logic
123
+ // - processTokenTransaction() - Framework doesn't handle transactions
124
+ // These can be added later if actually needed
125
+ }
@@ -0,0 +1,231 @@
1
+ import { TokenApi } from './api/token-api';
2
+ import { TokenService } from './services/token-service';
3
+ import { PersApiClient } from '../core/pers-api-client';
4
+ import {
5
+ TokenDTO,
6
+ TokenStorageData,
7
+ TokenCreateRequestDTO,
8
+ TokenUpdateRequestDTO,
9
+ TokenMetadataDTO
10
+ } from './models';
11
+ import { TokenTypeDTO } from '../shared/interfaces/pers-shared-lib.interfaces';
12
+
13
+ /**
14
+ * Token SDK - Class-based Promise SDK for Token Operations
15
+ *
16
+ * Modern, performant SDK with direct method access and excellent TypeScript support.
17
+ * Optimized for bundle size, performance, and developer experience.
18
+ *
19
+ * Usage:
20
+ * const tokenSDK = new TokenSDK(apiClient);
21
+ * const tokens = await tokenSDK.getTokens();
22
+ * const creditToken = await tokenSDK.getActiveCreditToken();
23
+ */
24
+ export class TokenSDK {
25
+ private readonly tokenApi: TokenApi;
26
+ private readonly tokenService: TokenService;
27
+
28
+ constructor(apiClient: PersApiClient) {
29
+ this.tokenApi = new TokenApi(apiClient);
30
+ this.tokenService = new TokenService(this.tokenApi);
31
+ }
32
+
33
+ // ==========================================
34
+ // CONVENIENCE METHODS - Direct Promise API
35
+ // ==========================================
36
+ // Simplified method names for better developer experience
37
+
38
+ /**
39
+ * Get all tokens
40
+ * @returns Promise with all available tokens
41
+ */
42
+ async getTokens(): Promise<TokenDTO[]> {
43
+ return this.tokenService.getRemoteTokens();
44
+ }
45
+
46
+ /**
47
+ * Get all token types
48
+ * @returns Promise with all available token types
49
+ */
50
+ async getTokenTypes(): Promise<TokenTypeDTO[]> {
51
+ return this.tokenService.getRemoteTokenTypes();
52
+ }
53
+
54
+ /**
55
+ * Get the active credit token
56
+ * @returns Promise with the current active credit token
57
+ */
58
+ async getActiveCreditToken(): Promise<TokenDTO> {
59
+ return this.tokenService.getRemoteActiveCreditToken();
60
+ }
61
+
62
+ /**
63
+ * Get all reward tokens
64
+ * @returns Promise with all reward tokens
65
+ */
66
+ async getRewardTokens(): Promise<TokenDTO[]> {
67
+ return this.tokenService.getRemoteRewardTokens();
68
+ }
69
+
70
+ /**
71
+ * Get all status tokens
72
+ * @returns Promise with all status tokens
73
+ */
74
+ async getStatusTokens(): Promise<TokenDTO[]> {
75
+ return this.tokenService.getRemoteStatusTokens();
76
+ }
77
+
78
+ /**
79
+ * Get token by contract address
80
+ * @param contractAddress - The contract address to search for
81
+ * @param contractTokenId - Optional contract token ID
82
+ * @returns Promise with the matching token
83
+ */
84
+ async getTokenByContract(contractAddress: string, contractTokenId: string | null = null): Promise<TokenDTO> {
85
+ return this.tokenService.getTokenByContractAddress(contractAddress, contractTokenId);
86
+ }
87
+
88
+ // ==========================================
89
+ // ADMIN METHODS - Token Management
90
+ // ==========================================
91
+
92
+ /**
93
+ * Create token metadata
94
+ * @param tokenId - The token ID
95
+ * @param tokenData - The token storage data
96
+ * @returns Promise with the updated token
97
+ */
98
+ async createTokenMetadata(tokenId: string, tokenData: TokenStorageData): Promise<TokenDTO> {
99
+ return this.tokenService.createTokenMetadata(tokenId, tokenData);
100
+ }
101
+
102
+ /**
103
+ * Toggle token active status
104
+ * @param tokenId - The token ID to toggle
105
+ * @returns Promise with the updated token
106
+ */
107
+ async toggleTokenActive(tokenId: string): Promise<TokenDTO> {
108
+ return this.tokenService.toggleTokenActive(tokenId);
109
+ }
110
+
111
+ /**
112
+ * Create a new token
113
+ * @param tokenData - The token creation data
114
+ * @returns Promise with the created token
115
+ */
116
+ async createToken(tokenData: TokenCreateRequestDTO): Promise<TokenDTO> {
117
+ return this.tokenService.createToken(tokenData);
118
+ }
119
+
120
+ /**
121
+ * Update an existing token
122
+ * @param tokenId - The token ID to update
123
+ * @param tokenData - The token update data
124
+ * @returns Promise with the updated token
125
+ */
126
+ async updateToken(tokenId: string, tokenData: TokenUpdateRequestDTO): Promise<TokenDTO> {
127
+ return this.tokenService.updateToken(tokenId, tokenData);
128
+ }
129
+
130
+ /**
131
+ * Set mainnet contract address for a token
132
+ * @param tokenId - The token ID
133
+ * @param contractAddress - The contract address
134
+ * @param chainId - The blockchain chain ID
135
+ * @returns Promise with the updated token
136
+ */
137
+ async setMainnetContract(tokenId: string, contractAddress: string, chainId: number): Promise<TokenDTO> {
138
+ return this.tokenService.setMainnetContract(tokenId, contractAddress, chainId);
139
+ }
140
+
141
+ /**
142
+ * Toggle token metadata status
143
+ * @param metadataId - The metadata ID to toggle
144
+ * @returns Promise with the updated metadata
145
+ */
146
+ async toggleTokenMetadataStatus(metadataId: string): Promise<TokenMetadataDTO> {
147
+ return this.tokenService.toggleTokenMetadataStatus(metadataId);
148
+ }
149
+
150
+ /**
151
+ * Create a new token type
152
+ * @param tokenType - The token type data
153
+ * @returns Promise with the created token type
154
+ */
155
+ async createTokenType(tokenType: TokenTypeDTO): Promise<TokenTypeDTO> {
156
+ return this.tokenService.createTokenType(tokenType);
157
+ }
158
+
159
+ // ==========================================
160
+ // ADVANCED ACCESS - For Complex Operations
161
+ // ==========================================
162
+
163
+ /**
164
+ * Get direct access to the token service for advanced operations
165
+ * @returns The underlying TokenService instance
166
+ */
167
+ getTokenService(): TokenService {
168
+ return this.tokenService;
169
+ }
170
+
171
+ /**
172
+ * Get direct access to the token API for low-level operations
173
+ * @returns The underlying TokenApi instance
174
+ */
175
+ getTokenApi(): TokenApi {
176
+ return this.tokenApi;
177
+ }
178
+
179
+ // ==========================================
180
+ // FRAMEWORK COMPATIBILITY METHODS
181
+ // ==========================================
182
+ // These maintain compatibility with existing framework method names
183
+
184
+ /**
185
+ * @deprecated Use getTokens() instead
186
+ * Framework compatibility method
187
+ */
188
+ async getRemoteTokens(): Promise<TokenDTO[]> {
189
+ return this.getTokens();
190
+ }
191
+
192
+ /**
193
+ * @deprecated Use getTokenTypes() instead
194
+ * Framework compatibility method
195
+ */
196
+ async getRemoteTokenTypes(): Promise<TokenTypeDTO[]> {
197
+ return this.getTokenTypes();
198
+ }
199
+
200
+ /**
201
+ * @deprecated Use getActiveCreditToken() instead
202
+ * Framework compatibility method
203
+ */
204
+ async getRemoteActiveCreditToken(): Promise<TokenDTO> {
205
+ return this.getActiveCreditToken();
206
+ }
207
+
208
+ /**
209
+ * @deprecated Use getRewardTokens() instead
210
+ * Framework compatibility method
211
+ */
212
+ async getRemoteRewardTokens(): Promise<TokenDTO[]> {
213
+ return this.getRewardTokens();
214
+ }
215
+
216
+ /**
217
+ * @deprecated Use getStatusTokens() instead
218
+ * Framework compatibility method
219
+ */
220
+ async getRemoteStatusTokens(): Promise<TokenDTO[]> {
221
+ return this.getStatusTokens();
222
+ }
223
+
224
+ /**
225
+ * @deprecated Use getTokenByContract() instead
226
+ * Framework compatibility method
227
+ */
228
+ async getTokenByContractAddress(contractAddress: string, contractTokenId: string | null): Promise<TokenDTO> {
229
+ return this.getTokenByContract(contractAddress, contractTokenId);
230
+ }
231
+ }