@cheqd/sdk 5.3.2 → 5.3.3-develop.1

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 (112) hide show
  1. package/README.md +310 -0
  2. package/build/cjs/index.d.ts +92 -1
  3. package/build/cjs/index.d.ts.map +1 -1
  4. package/build/cjs/index.js +75 -2
  5. package/build/cjs/index.js.map +1 -1
  6. package/build/cjs/modules/_.d.ts +61 -0
  7. package/build/cjs/modules/_.d.ts.map +1 -1
  8. package/build/cjs/modules/_.js +50 -0
  9. package/build/cjs/modules/_.js.map +1 -1
  10. package/build/cjs/modules/did.d.ts +278 -0
  11. package/build/cjs/modules/did.d.ts.map +1 -1
  12. package/build/cjs/modules/did.js +242 -0
  13. package/build/cjs/modules/did.js.map +1 -1
  14. package/build/cjs/modules/feeabstraction.d.ts +297 -2
  15. package/build/cjs/modules/feeabstraction.d.ts.map +1 -1
  16. package/build/cjs/modules/feeabstraction.js +235 -4
  17. package/build/cjs/modules/feeabstraction.js.map +1 -1
  18. package/build/cjs/modules/feemarket.d.ts +154 -21
  19. package/build/cjs/modules/feemarket.d.ts.map +1 -1
  20. package/build/cjs/modules/feemarket.js +133 -22
  21. package/build/cjs/modules/feemarket.js.map +1 -1
  22. package/build/cjs/modules/resource.d.ts +143 -0
  23. package/build/cjs/modules/resource.d.ts.map +1 -1
  24. package/build/cjs/modules/resource.js +131 -0
  25. package/build/cjs/modules/resource.js.map +1 -1
  26. package/build/cjs/querier.d.ts +50 -0
  27. package/build/cjs/querier.d.ts.map +1 -1
  28. package/build/cjs/querier.js +50 -0
  29. package/build/cjs/querier.js.map +1 -1
  30. package/build/cjs/registry.d.ts +14 -0
  31. package/build/cjs/registry.d.ts.map +1 -1
  32. package/build/cjs/registry.js +14 -0
  33. package/build/cjs/registry.js.map +1 -1
  34. package/build/cjs/signer.d.ts +172 -1
  35. package/build/cjs/signer.d.ts.map +1 -1
  36. package/build/cjs/signer.js +172 -1
  37. package/build/cjs/signer.js.map +1 -1
  38. package/build/cjs/types.d.ts +91 -0
  39. package/build/cjs/types.d.ts.map +1 -1
  40. package/build/cjs/types.js +17 -0
  41. package/build/cjs/types.js.map +1 -1
  42. package/build/cjs/utils.d.ts +188 -0
  43. package/build/cjs/utils.d.ts.map +1 -1
  44. package/build/cjs/utils.js +195 -0
  45. package/build/cjs/utils.js.map +1 -1
  46. package/build/esm/index.d.ts +92 -1
  47. package/build/esm/index.d.ts.map +1 -1
  48. package/build/esm/index.js +74 -1
  49. package/build/esm/index.js.map +1 -1
  50. package/build/esm/modules/_.d.ts +42 -0
  51. package/build/esm/modules/_.d.ts.map +1 -1
  52. package/build/esm/modules/_.js +32 -0
  53. package/build/esm/modules/_.js.map +1 -1
  54. package/build/esm/modules/did.d.ts +274 -0
  55. package/build/esm/modules/did.d.ts.map +1 -1
  56. package/build/esm/modules/did.js +242 -0
  57. package/build/esm/modules/did.js.map +1 -1
  58. package/build/esm/modules/feeabstraction.d.ts +277 -2
  59. package/build/esm/modules/feeabstraction.d.ts.map +1 -1
  60. package/build/esm/modules/feeabstraction.js +221 -2
  61. package/build/esm/modules/feeabstraction.js.map +1 -1
  62. package/build/esm/modules/feemarket.d.ts +152 -21
  63. package/build/esm/modules/feemarket.d.ts.map +1 -1
  64. package/build/esm/modules/feemarket.js +131 -21
  65. package/build/esm/modules/feemarket.js.map +1 -1
  66. package/build/esm/modules/resource.d.ts +142 -0
  67. package/build/esm/modules/resource.d.ts.map +1 -1
  68. package/build/esm/modules/resource.js +130 -0
  69. package/build/esm/modules/resource.js.map +1 -1
  70. package/build/esm/querier.d.ts +50 -0
  71. package/build/esm/querier.d.ts.map +1 -1
  72. package/build/esm/querier.js +50 -0
  73. package/build/esm/querier.js.map +1 -1
  74. package/build/esm/registry.d.ts +14 -0
  75. package/build/esm/registry.d.ts.map +1 -1
  76. package/build/esm/registry.js +14 -0
  77. package/build/esm/registry.js.map +1 -1
  78. package/build/esm/signer.d.ts +122 -0
  79. package/build/esm/signer.d.ts.map +1 -1
  80. package/build/esm/signer.js +122 -0
  81. package/build/esm/signer.js.map +1 -1
  82. package/build/esm/types.d.ts +92 -0
  83. package/build/esm/types.d.ts.map +1 -1
  84. package/build/esm/types.js +17 -0
  85. package/build/esm/types.js.map +1 -1
  86. package/build/esm/utils.d.ts +178 -0
  87. package/build/esm/utils.d.ts.map +1 -1
  88. package/build/esm/utils.js +171 -0
  89. package/build/esm/utils.js.map +1 -1
  90. package/build/types/index.d.ts +92 -1
  91. package/build/types/index.d.ts.map +1 -1
  92. package/build/types/modules/_.d.ts +42 -0
  93. package/build/types/modules/_.d.ts.map +1 -1
  94. package/build/types/modules/did.d.ts +274 -0
  95. package/build/types/modules/did.d.ts.map +1 -1
  96. package/build/types/modules/feeabstraction.d.ts +277 -2
  97. package/build/types/modules/feeabstraction.d.ts.map +1 -1
  98. package/build/types/modules/feemarket.d.ts +152 -21
  99. package/build/types/modules/feemarket.d.ts.map +1 -1
  100. package/build/types/modules/resource.d.ts +142 -0
  101. package/build/types/modules/resource.d.ts.map +1 -1
  102. package/build/types/querier.d.ts +50 -0
  103. package/build/types/querier.d.ts.map +1 -1
  104. package/build/types/registry.d.ts +14 -0
  105. package/build/types/registry.d.ts.map +1 -1
  106. package/build/types/signer.d.ts +122 -0
  107. package/build/types/signer.d.ts.map +1 -1
  108. package/build/types/types.d.ts +92 -0
  109. package/build/types/types.d.ts.map +1 -1
  110. package/build/types/utils.d.ts +178 -0
  111. package/build/types/utils.d.ts.map +1 -1
  112. package/package.json +1 -1
package/README.md CHANGED
@@ -33,6 +33,316 @@ With this SDK, developers are able to:
33
33
  * ✅ **Raw payload creator**: Enables users to generate a valid raw DID payload which is ready to be populated, depending on the use case. For example, `did-provider-cheqd` leverages this helper in the CLI application.
34
34
  * ✅ **Identity key converter**: Enables users to convert specific key formats from different kinds of SDKs, by transforming the input keys into valid sign inputs for a cheqd specific DID transaction (e.g. `createDidDocTx`, `updateDidDocTx`). For example, the Veramo SDK for cheqd uses this helper to enable users to pass a key in a Veramo SDK specific format to a cheqd sign input keys interface.
35
35
 
36
+ ## 💰 Fee Abstraction
37
+
38
+ The Cheqd SDK provides comprehensive fee abstraction functionality that allows users to pay transaction fees using IBC tokens from other chains instead of native CHEQ tokens. This feature enables cross-chain interoperability and improved user experience by allowing users to transact without holding native tokens.
39
+
40
+ ### Overview
41
+
42
+ Fee abstraction on Cheqd enables:
43
+
44
+ * **Cross-chain fee payments**: Pay transaction fees using tokens from other Cosmos chains
45
+ * **Host zone management**: Add and configure supported chains for fee abstraction
46
+ * **Automatic token swaps**: Convert IBC tokens to CHEQ for fee payment behind the scenes
47
+ * **Module account funding**: Provide liquidity for fee abstraction operations
48
+
49
+ ### 📁 Module Files
50
+
51
+ The fee abstraction functionality is implemented in the following files:
52
+
53
+ **CJS (CommonJS)**:
54
+
55
+ * Main module: [`cjs/src/modules/feeabstraction.ts`](./cjs/src/modules/feeabstraction.ts)
56
+ * Type definitions: [`cjs/src/types.ts`](./cjs/src/types.ts)
57
+
58
+ **ESM (ECMAScript Modules)**:
59
+
60
+ * Main module: [`esm/src/modules/feeabstraction.ts`](./esm/src/modules/feeabstraction.ts)
61
+ * Type definitions: [`esm/src/types.ts`](./esm/src/types.ts)
62
+
63
+ ### 🚀 Basic Usage
64
+
65
+ #### Setting up Fee Abstraction
66
+
67
+ ```typescript
68
+ import { createCheqdSDK, CheqdNetwork } from '@cheqd/sdk';
69
+
70
+ // Create wallet instance (e.g., using DirectSecp256k1HdWallet from CosmJS)
71
+ import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing';
72
+ const wallet = await DirectSecp256k1HdWallet.fromMnemonic('your mnemonic here', { prefix: 'cheqd' }); // replace with your mnemonic, remember to keep it secure
73
+
74
+ // Set up the SDK options with fee abstraction capabilities
75
+ const sdkOptions = {
76
+ modules: [
77
+ FeeabstractionModule as unknown as AbstractCheqdSDKModule,
78
+ // other modules can be added here
79
+ ],
80
+ // other SDK options can be configured here
81
+ rpcUrl: 'https://rpc.cheqd.network', // or your preferred RPC endpoint
82
+ network: CheqdNetwork.Testnet, // or CheqdNetwork.Mainnet
83
+ wallet,
84
+ };
85
+
86
+ // Initialize SDK with fee abstraction support
87
+ const sdk = await createCheqdSDK(sdkOptions);
88
+ ```
89
+
90
+ ### 💳 IBC Asset Requirements
91
+
92
+ Before using fee abstraction functionality, ensure that your account has the necessary IBC assets bridged from supported chains like Osmosis:
93
+
94
+ #### Bridging Assets from Osmosis
95
+
96
+ To use fee abstraction, you'll need to have IBC tokens in your Cheqd account that were bridged from Osmosis:
97
+
98
+ ```typescript
99
+ // Example IBC denominations that might be supported
100
+ const supportedIBCDenoms = [
101
+ 'ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4', // ATOM from Osmosis
102
+ 'ibc/14F9BC3E44B8A9C1BE1FB08980FAB87034C9905EF17CF2442BE1FA40E2E5F16', // OSMO from Osmosis
103
+ // Add other supported IBC denominations
104
+ ];
105
+
106
+ // Your account should have these IBC tokens available
107
+ async function checkIBCBalances(accountAddress: string) {
108
+ const balances = await sdk.querier.bank.allBalances({ address: accountAddress });
109
+
110
+ const ibcBalances = balances.balances.filter(balance =>
111
+ balance.denom.startsWith('ibc/')
112
+ );
113
+
114
+ console.log('Available IBC tokens:', ibcBalances);
115
+ return ibcBalances;
116
+ }
117
+ ```
118
+
119
+ **Note**: To bridge assets from Osmosis to Cheqd, you can use:
120
+
121
+ * [Osmosis Frontend](https://app.osmosis.zone/) for manual transfers
122
+ * [IBC Transfer tools](https://ibc.fun/) for cross-chain transfers
123
+ * Direct IBC transfer commands via CLI
124
+
125
+ ### 📊 Querying Fee Abstraction Data
126
+
127
+ #### Host Chain Configuration
128
+
129
+ ```typescript
130
+ async function queryHostChainConfig() {
131
+ const configResponse = await sdk.querier[defaultFeeabstractionExtensionKey].hostChainConfig({
132
+ // Query parameters can be added here if needed
133
+ });
134
+
135
+ console.log('Host chain configuration:', configResponse);
136
+ }
137
+ ```
138
+
139
+ #### Module Balances
140
+
141
+ ```typescript
142
+ async function queryModuleBalances() {
143
+ const balancesResponse = await sdk.querier[defaultFeeabstractionExtensionKey].feeabsModuleBalances({
144
+ // Query parameters can be added here if needed
145
+ });
146
+
147
+ console.log('Fee abstraction module balances:', balancesResponse);
148
+ }
149
+ ```
150
+
151
+ #### Osmosis TWAP Data
152
+
153
+ ```typescript
154
+ async function queryOsmosisTWAP() {
155
+ const twapResponse = await sdk.querier[defaultFeeabstractionExtensionKey].osmosisArithmeticTwap({
156
+ poolId: '1', // Pool ID on Osmosis
157
+ baseAsset: 'uosmo',
158
+ quoteAsset: 'ibc/ABC123...',
159
+ startTime: new Date(Date.now() - 24 * 60 * 60 * 1000), // 24 hours ago
160
+ endTime: new Date()
161
+ });
162
+
163
+ console.log('TWAP data:', twapResponse);
164
+ }
165
+ ```
166
+
167
+ ### 🏛️ Governance Operations
168
+
169
+ Fee abstraction supports governance proposals for configuration changes:
170
+
171
+ #### Adding a Host Zone
172
+
173
+ ```typescript
174
+ import { MsgAddHostZone } from '@cheqd/ts-proto/feeabstraction/feeabs/v1beta1/index';
175
+
176
+ async function proposeAddHostZone() {
177
+ const hostZoneData: MsgAddHostZone = {
178
+ authority: 'cheqd1gov...', // Governance authority address
179
+ hostChainId: 'osmosis-1',
180
+ connectionId: 'connection-0',
181
+ ibcDenom: 'ibc/ABC123...',
182
+ nativeDenom: 'uosmo',
183
+ transferChannelId: 'channel-0',
184
+ minSwapAmount: '1000'
185
+ };
186
+
187
+ const proposalResponse = await sdk.addHostZoneProposal(
188
+ hostZoneData,
189
+ 'Add Osmosis as Host Zone', // Proposal title
190
+ [{ denom: 'ncheq', amount: '10000000000' }], // Deposit
191
+ 'cheqd1proposer...', // Proposer address
192
+ {
193
+ amount: [{ denom: 'ncheq', amount: '5000' }],
194
+ gas: '300000'
195
+ }
196
+ );
197
+
198
+ console.log('Host zone proposal submitted:', proposalResponse.transactionHash);
199
+ }
200
+ ```
201
+
202
+ #### Updating Host Zone Configuration
203
+
204
+ ```typescript
205
+ async function proposeUpdateHostZone() {
206
+ const updateData = {
207
+ authority: 'cheqd1gov...',
208
+ hostChainId: 'osmosis-1',
209
+ // Updated configuration parameters
210
+ minSwapAmount: '2000' // New minimum swap amount
211
+ };
212
+
213
+ const updateResponse = await sdk.updateHostZoneProposal(
214
+ updateData,
215
+ 'Update Osmosis Host Zone Configuration',
216
+ [{ denom: 'ncheq', amount: '10000000000' }],
217
+ 'cheqd1proposer...',
218
+ {
219
+ amount: [{ denom: 'ncheq', amount: '5000' }],
220
+ gas: '300000'
221
+ }
222
+ );
223
+
224
+ console.log('Update proposal submitted:', updateResponse.transactionHash);
225
+ }
226
+ ```
227
+
228
+ ### 🔧 Advanced Configuration
229
+
230
+ #### TWAP Query for Price Data
231
+
232
+ ```typescript
233
+ async function sendTWAPQuery() {
234
+ const twapQueryResponse = await sdk.sendQueryIbcDenomTWAP(
235
+ 'cheqd1sender...',
236
+ 'ibc/ABC123...', // IBC denomination
237
+ {
238
+ amount: [{ denom: 'ncheq', amount: '5000' }],
239
+ gas: '200000'
240
+ },
241
+ 'Query TWAP for price data'
242
+ );
243
+
244
+ console.log('TWAP query sent:', twapQueryResponse);
245
+ }
246
+ ```
247
+
248
+ #### Complete Fee Abstraction Workflow
249
+
250
+ ```typescript
251
+ async function completeFeeAbstractionWorkflow() {
252
+ try {
253
+ // 1. Check account has IBC assets available
254
+ const accountAddress = 'cheqd1sender...';
255
+ const ibcBalances = await checkIBCBalances(accountAddress);
256
+
257
+ if (ibcBalances.length === 0) {
258
+ throw new Error('No IBC tokens available. Please bridge assets from Osmosis first.');
259
+ }
260
+
261
+ // 2. Query host chain configuration
262
+ const hostConfig = await sdk.querier[defaultFeeabstractionExtensionKey].hostChainConfig({});
263
+ console.log('Host chain config:', hostConfig);
264
+
265
+ // 3. Query current module balances
266
+ const moduleBalances = await sdk.querier[defaultFeeabstractionExtensionKey].feeabsModuleBalances({});
267
+ console.log('Module balances:', moduleBalances);
268
+
269
+ // 4. Use IBC tokens for transaction fees directly
270
+ // Fee abstraction automatically handles the conversion behind the scenes
271
+ console.log('Fee abstraction is ready for use with IBC tokens');
272
+
273
+ console.log('Fee abstraction workflow completed successfully');
274
+ } catch (error) {
275
+ console.error('Fee abstraction workflow failed:', error);
276
+ }
277
+ }
278
+ ```
279
+
280
+ ### 📋 Error Handling
281
+
282
+ ```typescript
283
+ async function handleFeeAbstractionErrors() {
284
+ try {
285
+ // Example: Using fee abstraction in a DID operation
286
+ const didCreationResponse = await sdk.createDidDocTx(
287
+ 'cheqd1sender...',
288
+ didDocument,
289
+ 'key1',
290
+ { amount: [{ denom: 'ibc/ABC123...', amount: '100000' }], gas: '300000' }
291
+ );
292
+ } catch (error) {
293
+ if (error.message.includes('insufficient funds')) {
294
+ console.error('Account has insufficient IBC tokens');
295
+ console.log('Please bridge more assets from Osmosis');
296
+ } else if (error.message.includes('invalid denom')) {
297
+ console.error('Invalid IBC denomination provided');
298
+ console.log('Check supported IBC denominations');
299
+ } else if (error.message.includes('host zone not found')) {
300
+ console.error('Host zone not configured for this IBC token');
301
+ } else {
302
+ console.error('Unexpected fee abstraction error:', error);
303
+ }
304
+ }
305
+ }
306
+ ```
307
+
308
+ ### 🔗 Integration with Other Modules
309
+
310
+ Fee abstraction can be used alongside other Cheqd SDK modules:
311
+
312
+ ```typescript
313
+ async function useWithDIDOperations() {
314
+ // Create a DID document using fee abstraction for payment
315
+ const didDocument = {
316
+ // DID document structure
317
+ };
318
+
319
+ // Use IBC tokens for fee payment via fee abstraction
320
+ const didCreationResponse = await sdk.createDidDocTx(
321
+ 'cheqd1creator...',
322
+ didDocument,
323
+ 'key1',
324
+ {
325
+ amount: [{ denom: 'ibc/ABC123...', amount: '100000' }], // Pay with IBC tokens
326
+ gas: '300000'
327
+ }
328
+ );
329
+
330
+ console.log('DID created with fee abstraction:', didCreationResponse.transactionHash);
331
+ }
332
+ ```
333
+
334
+ ### 💡 Best Practices
335
+
336
+ 1. **Bridge IBC Assets First**: Ensure you have bridged the required IBC tokens from Osmosis before attempting to use fee abstraction
337
+ 2. **Check Account Balances**: Verify your account has sufficient IBC token balances before transactions
338
+ 3. **Handle IBC Delays**: Account for IBC token transfer delays in your application flow
339
+ 4. **Validate Host Zones**: Always verify that host zones are properly configured before using IBC tokens
340
+ 5. **Error Recovery**: Implement robust error handling for network and token-related issues
341
+ 6. **Gas Estimation**: Use appropriate gas limits for transactions using fee abstraction
342
+ 7. **Monitor Supported Denominations**: Keep track of which IBC denominations are supported for fee abstraction
343
+
344
+ For more detailed information about fee abstraction concepts and implementation, visit our [fee abstraction documentation](https://docs.cheqd.io/product).
345
+
36
346
  ## 🧑‍💻 Developer Guide
37
347
 
38
348
  ### Installing in ESM projects
@@ -8,39 +8,130 @@ import { GasPrice } from '@cosmjs/stargate-cjs';
8
8
  import { CheqdQuerier } from './querier';
9
9
  import { FeemarketExtension, FeemarketModule, MinimalImportableFeemarketModule } from './modules/feemarket';
10
10
  import { FeeabstractionExtension, FeeabstractionModule, MinimalImportableFeeabstractionModule } from './modules/feeabstraction';
11
+ /**
12
+ * Configuration options for initializing the CheqdSDK
13
+ */
11
14
  export interface ICheqdSDKOptions {
15
+ /** Array of modules to be loaded and registered with the SDK */
12
16
  modules: AbstractCheqdSDKModule[];
17
+ /** Optional querier extensions to extend query functionality */
13
18
  querierExtensions?: Record<string, any>[];
19
+ /** RPC URL of the blockchain node to connect to */
14
20
  rpcUrl: string;
21
+ /** Network configuration (Mainnet, Testnet, etc.) */
15
22
  network?: CheqdNetwork;
23
+ /** Gas price configuration for transactions */
16
24
  gasPrice?: GasPrice;
25
+ /** List of method names that are authorized for execution */
17
26
  authorizedMethods?: string[];
27
+ /** Wallet instance for signing transactions */
18
28
  readonly wallet: OfflineSigner;
19
29
  }
30
+ /**
31
+ * Default SDK modules that provide core functionality for DID, Resource, Feemarket, and Fee abstraction operations
32
+ */
20
33
  export type DefaultCheqdSDKModules = MinimalImportableDIDModule & MinimalImportableResourceModule & MinimalImportableFeemarketModule & MinimalImportableFeeabstractionModule;
34
+ /**
35
+ * Main CheqdSDK class that provides a comprehensive interface for interacting with the Cheqd blockchain.
36
+ * This class orchestrates modules for DID operations, resource management, fee market interactions,
37
+ * and fee abstraction functionality.
38
+ */
21
39
  export interface CheqdSDK extends DefaultCheqdSDKModules {
22
40
  }
41
+ /**
42
+ * Main CheqdSDK class that provides a comprehensive interface for interacting with the Cheqd blockchain.
43
+ * This class orchestrates modules for DID operations, resource management, fee market interactions,
44
+ * and fee abstraction functionality.
45
+ */
23
46
  export declare class CheqdSDK {
47
+ /** Map of available methods from loaded modules */
24
48
  methods: IModuleMethodMap;
49
+ /** Signing client for executing transactions on the blockchain */
25
50
  signer: CheqdSigningStargateClient;
51
+ /** Query client with extensions for reading blockchain data */
26
52
  querier: CheqdQuerier & DidExtension & ResourceExtension & FeemarketExtension & FeeabstractionExtension;
53
+ /** Configuration options passed during SDK initialization */
27
54
  options: ICheqdSDKOptions;
55
+ /** List of method names that are protected from external access */
28
56
  private protectedMethods;
57
+ /**
58
+ * Constructs a new CheqdSDK instance with the provided configuration options.
59
+ *
60
+ * @param options - Configuration options for the SDK including wallet, modules, and network settings
61
+ * @throws {Error} Throws an error if no wallet is provided in the options
62
+ */
29
63
  constructor(options: ICheqdSDKOptions);
64
+ /**
65
+ * Executes a method from the loaded modules with the provided parameters.
66
+ * Only authorized methods can be executed through this interface.
67
+ *
68
+ * @template P - Type of parameters to pass to the method
69
+ * @template R - Return type of the method
70
+ * @param method - Name of the method to execute
71
+ * @param params - Parameters to pass to the method
72
+ * @returns Promise resolving to the method's return value
73
+ * @throws {Error} Throws an error if the method is not authorized
74
+ */
30
75
  execute<P = any, R = any>(method: string, ...params: P[]): Promise<R>;
76
+ /**
77
+ * Loads and instantiates the provided modules, making their methods available for execution.
78
+ * This method also applies mixins to make module methods accessible on the SDK instance.
79
+ *
80
+ * @param modules - Array of modules to load and integrate
81
+ * @returns Promise resolving to the CheqdSDK instance with loaded modules
82
+ * @private
83
+ */
31
84
  private loadModules;
85
+ /**
86
+ * Creates and configures a registry with types from all loaded modules.
87
+ * The registry is used for encoding and decoding blockchain messages.
88
+ *
89
+ * @returns Configured Registry instance with all module types
90
+ * @private
91
+ */
32
92
  private loadRegistry;
93
+ /**
94
+ * Establishes a connection to the blockchain querier with all necessary extensions.
95
+ * Extensions provide specialized query capabilities for different modules.
96
+ *
97
+ * @returns Promise resolving to a CheqdQuerier instance with all extensions
98
+ * @private
99
+ */
33
100
  private loadQuerierExtensions;
101
+ /**
102
+ * Builds and initializes the complete SDK instance by loading all components:
103
+ * registry, querier extensions, modules, gas price configuration, and signing client.
104
+ * This method must be called before the SDK can be used for blockchain operations.
105
+ *
106
+ * @returns Promise resolving to the fully initialized CheqdSDK instance
107
+ */
34
108
  build(): Promise<CheqdSDK>;
35
109
  }
110
+ /**
111
+ * Filters methods based on authorization rules and protected method restrictions.
112
+ * Returns only methods that are explicitly authorized (if authorization list is provided)
113
+ * and excludes protected methods from external access.
114
+ *
115
+ * @param methods - Map of all available methods from modules
116
+ * @param authorizedMethods - List of method names that are explicitly authorized
117
+ * @param protectedMethods - List of method names that should be protected from external access
118
+ * @returns Filtered map containing only authorized and non-protected methods
119
+ */
36
120
  export declare function filterUnauthorizedMethods(methods: IModuleMethodMap, authorizedMethods: string[], protectedMethods: string[]): IModuleMethodMap;
121
+ /**
122
+ * Factory function that creates and builds a fully initialized CheqdSDK instance.
123
+ * This is the recommended way to create an SDK instance as it handles all initialization steps.
124
+ *
125
+ * @param options - Configuration options for the SDK including wallet, modules, and network settings
126
+ * @returns Promise resolving to a fully initialized and ready-to-use CheqdSDK instance
127
+ */
37
128
  export declare function createCheqdSDK(options: ICheqdSDKOptions): Promise<CheqdSDK>;
38
129
  export { DIDModule, ResourceModule, FeemarketModule, FeeabstractionModule };
39
130
  export { AbstractCheqdSDKModule, applyMixins } from './modules/_';
40
131
  export { DidExtension, MinimalImportableDIDModule, MsgCreateDidDocEncodeObject, MsgCreateDidDocResponseEncodeObject, MsgUpdateDidDocEncodeObject, MsgUpdateDidDocResponseEncodeObject, MsgDeactivateDidDocEncodeObject, MsgDeactivateDidDocResponseEncodeObject, contexts, defaultDidExtensionKey, protobufLiterals as protobufLiteralsDid, typeUrlMsgCreateDidDoc, typeUrlMsgCreateDidDocResponse, typeUrlMsgUpdateDidDoc, typeUrlMsgUpdateDidDocResponse, typeUrlMsgDeactivateDidDoc, typeUrlMsgDeactivateDidDocResponse, setupDidExtension, isMsgCreateDidDocEncodeObject, isMsgUpdateDidDocEncodeObject, isMsgDeactivateDidDocEncodeObject, } from './modules/did';
41
132
  export { ResourceExtension, MinimalImportableResourceModule, defaultResourceExtensionKey, protobufLiterals as protobufLiteralsResource, typeUrlMsgCreateResource, typeUrlMsgCreateResourceResponse, setupResourceExtension, isMsgCreateResourceEncodeObject, } from './modules/resource';
42
133
  export { FeemarketExtension, MinimalImportableFeemarketModule, DefaultGasPriceTiers, defaultFeemarketExtensionKey, defaultGasPriceTiers, protobufLiterals as protobufLiteralsFeemarket, typeUrlGasPriceResponse, typeUrlGasPricesResponse, typeUrlParamsResponse, setupFeemarketExtension, isGasPriceEncodeObject, isGasPricesEncodeObject, isParamsEncodeObject, } from './modules/feemarket';
43
- export { FeeabstractionExtension, MinimalImportableFeeabstractionModule, defaultExtensionKey, protobufLiterals as protobufLiteralsFeeabstraction, typeUrlMsgAddHostZone, typeUrlMsgAddHostZoneResponse, typeUrlMsgFundFeeAbsModuleAccount, typeUrlMsgFundFeeAbsModuleAccountResponse, typeUrlMsgRemoveHostZone, typeUrlMsgRemoveHostZoneResponse, typeUrlMsgUpdateHostZone, typeUrlMsgUpdateHostZoneResponse, typeUrlMsgSendQueryIbcDenomTWAP, typeUrlMsgSendQueryIbcDenomTWAPResponse, typeUrlMsgSwapCrossChain, typeUrlMsgSwapCrossChainResponse, typeUrlMsgUpdateParams, typeUrlMsgUpdateParamsResponse, setupFeeabstractionExtension, isMsgAddHostZoneEncodeObject, isMsgAddHostZoneResponseEncodeObject, isMsgFundFeeAbsModuleAccountEncodeObject, isMsgFundFeeAbsModuleAccountResponseEncodeObject, isMsgRemoveHostZoneEncodeObject, isMsgRemoveHostZoneResponseEncodeObject, isMsgUpdateHostZoneEncodeObject, isMsgUpdateHostZoneResponseEncodeObject, isMsgSendQueryIbcDenomTWAPEncodeObject, isMsgSendQueryIbcDenomTWAPResponseEncodeObject, isMsgSwapCrossChainEncodeObject, isMsgSwapCrossChainResponseEncodeObject, isMsgUpdateParamsEncodeObject, isMsgUpdateParamsResponseEncodeObject, } from './modules/feeabstraction';
134
+ export { FeeabstractionExtension, MinimalImportableFeeabstractionModule, defaultFeeabstractionExtensionKey, protobufLiterals as protobufLiteralsFeeabstraction, typeUrlMsgAddHostZone, typeUrlMsgAddHostZoneResponse, typeUrlMsgFundFeeAbsModuleAccount, typeUrlMsgFundFeeAbsModuleAccountResponse, typeUrlMsgRemoveHostZone, typeUrlMsgRemoveHostZoneResponse, typeUrlMsgUpdateHostZone, typeUrlMsgUpdateHostZoneResponse, typeUrlMsgSendQueryIbcDenomTWAP, typeUrlMsgSendQueryIbcDenomTWAPResponse, typeUrlMsgSwapCrossChain, typeUrlMsgSwapCrossChainResponse, typeUrlMsgUpdateParams, typeUrlMsgUpdateParamsResponse, setupFeeabstractionExtension, isMsgAddHostZoneEncodeObject, isMsgAddHostZoneResponseEncodeObject, isMsgFundFeeAbsModuleAccountEncodeObject, isMsgFundFeeAbsModuleAccountResponseEncodeObject, isMsgRemoveHostZoneEncodeObject, isMsgRemoveHostZoneResponseEncodeObject, isMsgUpdateHostZoneEncodeObject, isMsgUpdateHostZoneResponseEncodeObject, isMsgSendQueryIbcDenomTWAPEncodeObject, isMsgSendQueryIbcDenomTWAPResponseEncodeObject, isMsgSwapCrossChainEncodeObject, isMsgSwapCrossChainResponseEncodeObject, isMsgUpdateParamsEncodeObject, isMsgUpdateParamsResponseEncodeObject, } from './modules/feeabstraction';
44
135
  export * from './signer';
45
136
  export * from './querier';
46
137
  export * from './registry';
@@ -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EAC9C,+BAA+B,EAC/B,uCAAuC,EACvC,6BAA6B,EAC7B,qCAAqC,GACrC,MAAM,0BAA0B,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,gBAAgB,EAChB,wCAAwC,EACxC,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACd,MAAM,SAAS,CAAC"}
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.typeUrlMsgUpdateHostZoneResponse = exports.typeUrlMsgUpdateHostZone = exports.typeUrlMsgRemoveHostZoneResponse = exports.typeUrlMsgRemoveHostZone = exports.typeUrlMsgFundFeeAbsModuleAccountResponse = exports.typeUrlMsgFundFeeAbsModuleAccount = exports.typeUrlMsgAddHostZoneResponse = exports.typeUrlMsgAddHostZone = exports.protobufLiteralsFeeabstraction = exports.defaultExtensionKey = exports.isParamsEncodeObject = exports.isGasPricesEncodeObject = exports.isGasPriceEncodeObject = exports.setupFeemarketExtension = exports.typeUrlParamsResponse = exports.typeUrlGasPricesResponse = exports.typeUrlGasPriceResponse = exports.protobufLiteralsFeemarket = exports.defaultGasPriceTiers = exports.defaultFeemarketExtensionKey = exports.isMsgCreateResourceEncodeObject = exports.setupResourceExtension = exports.typeUrlMsgCreateResourceResponse = exports.typeUrlMsgCreateResource = exports.protobufLiteralsResource = exports.defaultResourceExtensionKey = exports.isMsgDeactivateDidDocEncodeObject = exports.isMsgUpdateDidDocEncodeObject = exports.isMsgCreateDidDocEncodeObject = exports.setupDidExtension = exports.typeUrlMsgDeactivateDidDocResponse = exports.typeUrlMsgDeactivateDidDoc = exports.typeUrlMsgUpdateDidDocResponse = exports.typeUrlMsgUpdateDidDoc = exports.typeUrlMsgCreateDidDocResponse = exports.typeUrlMsgCreateDidDoc = exports.protobufLiteralsDid = exports.defaultDidExtensionKey = exports.contexts = exports.MsgDeactivateDidDocEncodeObject = exports.MsgUpdateDidDocResponseEncodeObject = exports.MsgUpdateDidDocEncodeObject = exports.MsgCreateDidDocResponseEncodeObject = exports.applyMixins = exports.AbstractCheqdSDKModule = exports.FeeabstractionModule = exports.FeemarketModule = exports.ResourceModule = exports.DIDModule = exports.CheqdSDK = void 0;
17
+ exports.typeUrlMsgUpdateHostZoneResponse = exports.typeUrlMsgUpdateHostZone = exports.typeUrlMsgRemoveHostZoneResponse = exports.typeUrlMsgRemoveHostZone = exports.typeUrlMsgFundFeeAbsModuleAccountResponse = exports.typeUrlMsgFundFeeAbsModuleAccount = exports.typeUrlMsgAddHostZoneResponse = exports.typeUrlMsgAddHostZone = exports.protobufLiteralsFeeabstraction = exports.defaultFeeabstractionExtensionKey = exports.isParamsEncodeObject = exports.isGasPricesEncodeObject = exports.isGasPriceEncodeObject = exports.setupFeemarketExtension = exports.typeUrlParamsResponse = exports.typeUrlGasPricesResponse = exports.typeUrlGasPriceResponse = exports.protobufLiteralsFeemarket = exports.defaultGasPriceTiers = exports.defaultFeemarketExtensionKey = exports.isMsgCreateResourceEncodeObject = exports.setupResourceExtension = exports.typeUrlMsgCreateResourceResponse = exports.typeUrlMsgCreateResource = exports.protobufLiteralsResource = exports.defaultResourceExtensionKey = exports.isMsgDeactivateDidDocEncodeObject = exports.isMsgUpdateDidDocEncodeObject = exports.isMsgCreateDidDocEncodeObject = exports.setupDidExtension = exports.typeUrlMsgDeactivateDidDocResponse = exports.typeUrlMsgDeactivateDidDoc = exports.typeUrlMsgUpdateDidDocResponse = exports.typeUrlMsgUpdateDidDoc = exports.typeUrlMsgCreateDidDocResponse = exports.typeUrlMsgCreateDidDoc = exports.protobufLiteralsDid = exports.defaultDidExtensionKey = exports.contexts = exports.MsgDeactivateDidDocEncodeObject = exports.MsgUpdateDidDocResponseEncodeObject = exports.MsgUpdateDidDocEncodeObject = exports.MsgCreateDidDocResponseEncodeObject = exports.applyMixins = exports.AbstractCheqdSDKModule = exports.FeeabstractionModule = exports.FeemarketModule = exports.ResourceModule = exports.DIDModule = exports.CheqdSDK = void 0;
18
18
  exports.toMultibaseRaw = exports.checkBalance = exports.getCosmosAccount = exports.createCosmosPayerWallet = exports.isEqualKeyValuePair = exports.validateSpecCompliantPayload = exports.createSignInputsFromImportableEd25519Key = exports.createDidPayload = exports.createDidVerificationMethod = exports.createVerificationKeys = exports.createKeyPairHex = exports.createKeyPairBase64 = exports.createKeyPairRaw = exports.TImportableEd25519Key = exports.isMsgUpdateParamsResponseEncodeObject = exports.isMsgUpdateParamsEncodeObject = exports.isMsgSwapCrossChainResponseEncodeObject = exports.isMsgSwapCrossChainEncodeObject = exports.isMsgSendQueryIbcDenomTWAPResponseEncodeObject = exports.isMsgSendQueryIbcDenomTWAPEncodeObject = exports.isMsgUpdateHostZoneResponseEncodeObject = exports.isMsgUpdateHostZoneEncodeObject = exports.isMsgRemoveHostZoneResponseEncodeObject = exports.isMsgRemoveHostZoneEncodeObject = exports.isMsgFundFeeAbsModuleAccountResponseEncodeObject = exports.isMsgFundFeeAbsModuleAccountEncodeObject = exports.isMsgAddHostZoneResponseEncodeObject = exports.isMsgAddHostZoneEncodeObject = exports.setupFeeabstractionExtension = exports.typeUrlMsgUpdateParamsResponse = exports.typeUrlMsgUpdateParams = exports.typeUrlMsgSwapCrossChainResponse = exports.typeUrlMsgSwapCrossChain = exports.typeUrlMsgSendQueryIbcDenomTWAPResponse = exports.typeUrlMsgSendQueryIbcDenomTWAP = void 0;
19
19
  exports.filterUnauthorizedMethods = filterUnauthorizedMethods;
20
20
  exports.createCheqdSDK = createCheqdSDK;
@@ -32,12 +32,28 @@ const feemarket_1 = require("./modules/feemarket");
32
32
  Object.defineProperty(exports, "FeemarketModule", { enumerable: true, get: function () { return feemarket_1.FeemarketModule; } });
33
33
  const feeabstraction_1 = require("./modules/feeabstraction");
34
34
  Object.defineProperty(exports, "FeeabstractionModule", { enumerable: true, get: function () { return feeabstraction_1.FeeabstractionModule; } });
35
+ /**
36
+ * Main CheqdSDK class that provides a comprehensive interface for interacting with the Cheqd blockchain.
37
+ * This class orchestrates modules for DID operations, resource management, fee market interactions,
38
+ * and fee abstraction functionality.
39
+ */
35
40
  class CheqdSDK {
41
+ /** Map of available methods from loaded modules */
36
42
  methods;
43
+ /** Signing client for executing transactions on the blockchain */
37
44
  signer;
45
+ /** Query client with extensions for reading blockchain data */
38
46
  querier;
47
+ /** Configuration options passed during SDK initialization */
39
48
  options;
49
+ /** List of method names that are protected from external access */
40
50
  protectedMethods = ['constructor', 'build', 'loadModules', 'loadRegistry'];
51
+ /**
52
+ * Constructs a new CheqdSDK instance with the provided configuration options.
53
+ *
54
+ * @param options - Configuration options for the SDK including wallet, modules, and network settings
55
+ * @throws {Error} Throws an error if no wallet is provided in the options
56
+ */
41
57
  constructor(options) {
42
58
  if (!options?.wallet) {
43
59
  throw new Error('No wallet provided');
@@ -51,12 +67,31 @@ class CheqdSDK {
51
67
  this.signer = new signer_1.CheqdSigningStargateClient(undefined, this.options.wallet, {});
52
68
  this.querier = new stargate_cjs_1.QueryClient({});
53
69
  }
70
+ /**
71
+ * Executes a method from the loaded modules with the provided parameters.
72
+ * Only authorized methods can be executed through this interface.
73
+ *
74
+ * @template P - Type of parameters to pass to the method
75
+ * @template R - Return type of the method
76
+ * @param method - Name of the method to execute
77
+ * @param params - Parameters to pass to the method
78
+ * @returns Promise resolving to the method's return value
79
+ * @throws {Error} Throws an error if the method is not authorized
80
+ */
54
81
  async execute(method, ...params) {
55
82
  if (!Object.keys(this.methods).includes(method)) {
56
83
  throw new Error(`Method ${method} is not authorized`);
57
84
  }
58
85
  return await this.methods[method](...params, { sdk: this });
59
86
  }
87
+ /**
88
+ * Loads and instantiates the provided modules, making their methods available for execution.
89
+ * This method also applies mixins to make module methods accessible on the SDK instance.
90
+ *
91
+ * @param modules - Array of modules to load and integrate
92
+ * @returns Promise resolving to the CheqdSDK instance with loaded modules
93
+ * @private
94
+ */
60
95
  async loadModules(modules) {
61
96
  this.options.modules = this.options.modules.map((module) => (0, _1.instantiateCheqdSDKModule)(module, this.signer, this.querier, {
62
97
  sdk: this,
@@ -74,6 +109,13 @@ class CheqdSDK {
74
109
  }
75
110
  return this;
76
111
  }
112
+ /**
113
+ * Creates and configures a registry with types from all loaded modules.
114
+ * The registry is used for encoding and decoding blockchain messages.
115
+ *
116
+ * @returns Configured Registry instance with all module types
117
+ * @private
118
+ */
77
119
  loadRegistry() {
78
120
  const registryTypes = this.options.modules
79
121
  .map((module) => (0, _1.instantiateCheqdSDKModuleRegistryTypes)(module))
@@ -82,11 +124,25 @@ class CheqdSDK {
82
124
  });
83
125
  return (0, registry_1.createDefaultCheqdRegistry)(registryTypes);
84
126
  }
127
+ /**
128
+ * Establishes a connection to the blockchain querier with all necessary extensions.
129
+ * Extensions provide specialized query capabilities for different modules.
130
+ *
131
+ * @returns Promise resolving to a CheqdQuerier instance with all extensions
132
+ * @private
133
+ */
85
134
  async loadQuerierExtensions() {
86
135
  const querierExtensions = this.options.modules.map((module) => (0, _1.instantiateCheqdSDKModuleQuerierExtensionSetup)(module));
87
136
  const querier = await querier_1.CheqdQuerier.connectWithExtensions(this.options.rpcUrl, ...querierExtensions);
88
137
  return querier;
89
138
  }
139
+ /**
140
+ * Builds and initializes the complete SDK instance by loading all components:
141
+ * registry, querier extensions, modules, gas price configuration, and signing client.
142
+ * This method must be called before the SDK can be used for blockchain operations.
143
+ *
144
+ * @returns Promise resolving to the fully initialized CheqdSDK instance
145
+ */
90
146
  async build() {
91
147
  const registry = this.loadRegistry();
92
148
  this.querier = await this.loadQuerierExtensions();
@@ -107,6 +163,16 @@ class CheqdSDK {
107
163
  }
108
164
  }
109
165
  exports.CheqdSDK = CheqdSDK;
166
+ /**
167
+ * Filters methods based on authorization rules and protected method restrictions.
168
+ * Returns only methods that are explicitly authorized (if authorization list is provided)
169
+ * and excludes protected methods from external access.
170
+ *
171
+ * @param methods - Map of all available methods from modules
172
+ * @param authorizedMethods - List of method names that are explicitly authorized
173
+ * @param protectedMethods - List of method names that should be protected from external access
174
+ * @returns Filtered map containing only authorized and non-protected methods
175
+ */
110
176
  function filterUnauthorizedMethods(methods, authorizedMethods, protectedMethods) {
111
177
  let _methods = Object.keys(methods);
112
178
  if (authorizedMethods.length === 0)
@@ -117,6 +183,13 @@ function filterUnauthorizedMethods(methods, authorizedMethods, protectedMethods)
117
183
  .filter((method) => authorizedMethods.includes(method) && !protectedMethods.includes(method))
118
184
  .reduce((acc, method) => ({ ...acc, [method]: methods[method] }), {});
119
185
  }
186
+ /**
187
+ * Factory function that creates and builds a fully initialized CheqdSDK instance.
188
+ * This is the recommended way to create an SDK instance as it handles all initialization steps.
189
+ *
190
+ * @param options - Configuration options for the SDK including wallet, modules, and network settings
191
+ * @returns Promise resolving to a fully initialized and ready-to-use CheqdSDK instance
192
+ */
120
193
  async function createCheqdSDK(options) {
121
194
  return await new CheqdSDK(options).build();
122
195
  }
@@ -160,7 +233,7 @@ Object.defineProperty(exports, "isGasPriceEncodeObject", { enumerable: true, get
160
233
  Object.defineProperty(exports, "isGasPricesEncodeObject", { enumerable: true, get: function () { return feemarket_2.isGasPricesEncodeObject; } });
161
234
  Object.defineProperty(exports, "isParamsEncodeObject", { enumerable: true, get: function () { return feemarket_2.isParamsEncodeObject; } });
162
235
  var feeabstraction_2 = require("./modules/feeabstraction");
163
- Object.defineProperty(exports, "defaultExtensionKey", { enumerable: true, get: function () { return feeabstraction_2.defaultExtensionKey; } });
236
+ Object.defineProperty(exports, "defaultFeeabstractionExtensionKey", { enumerable: true, get: function () { return feeabstraction_2.defaultFeeabstractionExtensionKey; } });
164
237
  Object.defineProperty(exports, "protobufLiteralsFeeabstraction", { enumerable: true, get: function () { return feeabstraction_2.protobufLiterals; } });
165
238
  Object.defineProperty(exports, "typeUrlMsgAddHostZone", { enumerable: true, get: function () { return feeabstraction_2.typeUrlMsgAddHostZone; } });
166
239
  Object.defineProperty(exports, "typeUrlMsgAddHostZoneResponse", { enumerable: true, get: function () { return feeabstraction_2.typeUrlMsgAddHostZoneResponse; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../cjs/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAqJA,8DAcC;AAED,wCAEC;AAtKD,uCAAoF;AAwK3E,0FAxKA,eAAS,OAwKA;AAvKlB,iDAAwG;AAuKpF,+FAvKsB,yBAAc,OAuKtB;AAtKlC,kCAMqB;AACrB,yCAAwD;AACxD,qCAAsD;AACtD,mCAAmE;AACnE,uDAA6D;AAC7D,uCAAyC;AAEzC,mDAK6B;AAoJO,gGAtJnC,2BAAe,OAsJmC;AAnJnD,6DAIkC;AA+ImB,qGAjJpD,qCAAoB,OAiJoD;AA5HzE,MAAa,QAAQ;IACpB,OAAO,CAAmB;IAC1B,MAAM,CAA6B;IACnC,OAAO,CAAiG;IACxG,OAAO,CAAmB;IAClB,gBAAgB,GAAa,CAAC,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;IAE7F,YAAY,OAAyB;QACpC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,OAAO,GAAG;YACd,iBAAiB,EAAE,EAAE;YACrB,OAAO,EAAE,oBAAY,CAAC,OAAO;YAC7B,GAAG,OAAO;SACV,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,IAAI,mCAA0B,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC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