@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
@@ -6,57 +6,200 @@ import { Metadata, MsgCreateResource, MsgCreateResourcePayload, QueryCollectionR
6
6
  import { DeliverTxResponse, QueryClient } from '@cosmjs/stargate-cjs';
7
7
  import { SignInfo } from '@cheqd/ts-proto-cjs/cheqd/did/v2/index';
8
8
  import { CheqdQuerier } from '../querier';
9
+ /** Default extension key for resource-related query operations */
9
10
  export declare const defaultResourceExtensionKey: "resource";
11
+ /**
12
+ * Protobuf message type literals for resource operations.
13
+ * Used for consistent message type identification across the module.
14
+ */
10
15
  export declare const protobufLiterals: {
16
+ /** Create resource message type */
11
17
  readonly MsgCreateResource: "MsgCreateResource";
18
+ /** Create resource response message type */
12
19
  readonly MsgCreateResourceResponse: "MsgCreateResourceResponse";
13
20
  };
21
+ /** Type URL for MsgCreateResource messages */
14
22
  export declare const typeUrlMsgCreateResource: "/cheqd.resource.v2.MsgCreateResource";
23
+ /** Type URL for MsgCreateResourceResponse messages */
15
24
  export declare const typeUrlMsgCreateResourceResponse: "/cheqd.resource.v2.MsgCreateResourceResponse";
25
+ /**
26
+ * Encode object interface for MsgCreateResource messages.
27
+ * Used for type-safe message encoding in resource creation transactions.
28
+ */
16
29
  export interface MsgCreateResourceEncodeObject extends EncodeObject {
17
30
  readonly typeUrl: typeof typeUrlMsgCreateResource;
18
31
  readonly value: Partial<MsgCreateResource>;
19
32
  }
33
+ /**
34
+ * Type guard function to check if an object is a MsgCreateResourceEncodeObject.
35
+ *
36
+ * @param obj - EncodeObject to check
37
+ * @returns True if the object is a MsgCreateResourceEncodeObject
38
+ */
20
39
  export declare function isMsgCreateResourceEncodeObject(obj: EncodeObject): obj is MsgCreateResourceEncodeObject;
40
+ /** Minimal importable version of the resource module for clean external interfaces */
21
41
  export type MinimalImportableResourceModule = MinimalImportableCheqdSDKModule<ResourceModule>;
42
+ /**
43
+ * Resource extension interface for querier functionality.
44
+ * Provides methods for querying resources and their metadata.
45
+ */
22
46
  export type ResourceExtension = {
23
47
  readonly [defaultResourceExtensionKey]: {
48
+ /** Query a specific resource by collection and resource ID */
24
49
  readonly resource: (collectionId: string, resourceId: string) => Promise<ResourceWithMetadata>;
50
+ /** Query metadata for a specific resource */
25
51
  readonly resourceMetadata: (collectionId: string, resourceId: string) => Promise<Metadata>;
52
+ /** Query all resources in a collection with pagination support */
26
53
  readonly collectionResources: (collectionId: string, paginationKey?: Uint8Array) => Promise<QueryCollectionResourcesResponse>;
27
54
  };
28
55
  };
56
+ /**
57
+ * Sets up the resource extension for the querier client.
58
+ * Creates and configures the resource-specific query methods.
59
+ *
60
+ * @param base - Base QueryClient to extend
61
+ * @returns Configured resource extension with query methods
62
+ */
29
63
  export declare const setupResourceExtension: (base: QueryClient) => ResourceExtension;
64
+ /**
65
+ * Resource Module class providing comprehensive linked resource functionality.
66
+ * Handles creation, querying, and metadata management of resources linked to DID documents.
67
+ */
30
68
  export declare class ResourceModule extends AbstractCheqdSDKModule {
31
69
  static readonly registryTypes: Iterable<[string, GeneratedType]>;
70
+ /** Base denomination for Cheqd network transactions */
32
71
  static readonly baseMinimalDenom: "ncheq";
72
+ /**
73
+ * Standard fee amounts for different resource types.
74
+ * Fees vary based on resource content type and processing requirements.
75
+ */
33
76
  static readonly fees: {
77
+ /** Default fee for creating image resources */
34
78
  readonly DefaultCreateResourceImageFee: {
35
79
  readonly amount: "10000000000";
36
80
  readonly denom: "ncheq";
37
81
  };
82
+ /** Default fee for creating JSON resources */
38
83
  readonly DefaultCreateResourceJsonFee: {
39
84
  readonly amount: "10000000000";
40
85
  readonly denom: "ncheq";
41
86
  };
87
+ /** Default fee for creating other types of resources */
42
88
  readonly DefaultCreateResourceDefaultFee: {
43
89
  readonly amount: "10000000000";
44
90
  readonly denom: "ncheq";
45
91
  };
46
92
  };
93
+ /** Querier extension setup function for resource operations */
47
94
  static readonly querierExtensionSetup: QueryExtensionSetup<ResourceExtension>;
95
+ /** Querier instance with resource extension capabilities */
96
+ /** Querier instance with resource extension capabilities */
48
97
  querier: CheqdQuerier & ResourceExtension;
98
+ /**
99
+ * Constructs a new resource module instance.
100
+ *
101
+ * @param signer - Signing client for blockchain transactions
102
+ * @param querier - Querier client with resource extension for data retrieval
103
+ */
49
104
  constructor(signer: CheqdSigningStargateClient, querier: CheqdQuerier & ResourceExtension);
105
+ /**
106
+ * Gets the registry types for resource message encoding/decoding.
107
+ *
108
+ * @returns Iterable of [typeUrl, GeneratedType] pairs for the registry
109
+ */
50
110
  getRegistryTypes(): Iterable<[string, GeneratedType]>;
111
+ /**
112
+ * Gets the querier extension setup for resource operations.
113
+ *
114
+ * @returns Query extension setup function for resource functionality
115
+ */
51
116
  getQuerierExtensionSetup(): QueryExtensionSetup<ResourceExtension>;
117
+ /**
118
+ * Signs a resource payload with provided signature inputs.
119
+ * Creates a complete signed resource message ready for blockchain submission.
120
+ *
121
+ * @param payload - Resource payload to sign
122
+ * @param signInputs - Signing inputs or pre-computed signatures
123
+ * @returns Promise resolving to the signed resource message
124
+ */
52
125
  static signPayload(payload: MsgCreateResourcePayload, signInputs: ISignInputs[] | SignInfo[]): Promise<MsgCreateResource>;
126
+ /**
127
+ * Creates a linked resource transaction on the blockchain.
128
+ * Handles automatic fee calculation based on resource content type and size.
129
+ *
130
+ * @param signInputs - Signing inputs or pre-computed signatures for the transaction
131
+ * @param resourcePayload - Resource payload containing data and metadata
132
+ * @param address - Address of the account submitting the transaction
133
+ * @param fee - Transaction fee configuration or 'auto' for automatic calculation
134
+ * @param memo - Optional transaction memo
135
+ * @param context - Optional SDK context for accessing clients
136
+ * @returns Promise resolving to the transaction response
137
+ * @throws Error if linked resource data is empty when automatic fee calculation is requested
138
+ */
53
139
  createLinkedResourceTx(signInputs: ISignInputs[] | SignInfo[], resourcePayload: Partial<MsgCreateResourcePayload>, address: string, fee?: DidStdFee | 'auto' | number, memo?: string, context?: IContext): Promise<DeliverTxResponse>;
140
+ /**
141
+ * Queries a specific linked resource by collection and resource ID.
142
+ * Retrieves the complete resource data along with its metadata.
143
+ *
144
+ * @param collectionId - ID of the collection containing the resource
145
+ * @param resourceId - ID of the resource to query
146
+ * @param context - Optional SDK context for accessing clients
147
+ * @returns Promise resolving to the resource with metadata
148
+ */
54
149
  queryLinkedResource(collectionId: string, resourceId: string, context?: IContext): Promise<ResourceWithMetadata>;
150
+ /**
151
+ * Queries metadata for a specific linked resource.
152
+ * Retrieves only the metadata without the resource content data.
153
+ *
154
+ * @param collectionId - ID of the collection containing the resource
155
+ * @param resourceId - ID of the resource to query metadata for
156
+ * @param context - Optional SDK context for accessing clients
157
+ * @returns Promise resolving to the resource metadata
158
+ */
55
159
  queryLinkedResourceMetadata(collectionId: string, resourceId: string, context?: IContext): Promise<Metadata>;
160
+ /**
161
+ * Queries all resources in a collection with pagination support.
162
+ * Retrieves a list of all resources belonging to a specific collection.
163
+ *
164
+ * @param collectionId - ID of the collection to query resources for
165
+ * @param context - Optional SDK context for accessing clients
166
+ * @returns Promise resolving to the collection resources response with pagination
167
+ */
56
168
  queryLinkedResources(collectionId: string, context?: IContext): Promise<QueryCollectionResourcesResponse>;
169
+ /**
170
+ * Reads and determines the MIME type of resource content.
171
+ * Analyzes the content to identify the appropriate MIME type for fee calculation and validation.
172
+ *
173
+ * @param content - Resource content as byte array
174
+ * @returns Promise resolving to the detected MIME type string
175
+ */
57
176
  static readMimeType(content: Uint8Array): Promise<string>;
177
+ /**
178
+ * Generates fee configuration for image resource creation transactions.
179
+ * Uses higher gas limits appropriate for image processing and storage.
180
+ *
181
+ * @param feePayer - Address of the account that will pay the transaction fees
182
+ * @param granter - Optional address of the account granting fee payment permissions
183
+ * @returns Promise resolving to the fee configuration for image resources
184
+ */
58
185
  static generateCreateResourceImageFees(feePayer: string, granter?: string): Promise<DidStdFee>;
186
+ /**
187
+ * Generates fee configuration for JSON resource creation transactions.
188
+ * Uses gas limits optimized for JSON data processing and validation.
189
+ *
190
+ * @param feePayer - Address of the account that will pay the transaction fees
191
+ * @param granter - Optional address of the account granting fee payment permissions
192
+ * @returns Promise resolving to the fee configuration for JSON resources
193
+ */
59
194
  static generateCreateResourceJsonFees(feePayer: string, granter?: string): Promise<DidStdFee>;
195
+ /**
196
+ * Generates fee configuration for default resource creation transactions.
197
+ * Uses standard gas limits for generic resource types and binary data.
198
+ *
199
+ * @param feePayer - Address of the account that will pay the transaction fees
200
+ * @param granter - Optional address of the account granting fee payment permissions
201
+ * @returns Promise resolving to the fee configuration for default resources
202
+ */
60
203
  static generateCreateResourceDefaultFees(feePayer: string, granter?: string): Promise<DidStdF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-type-cjs/browser");
12
12
  const utils_cjs_1 = require("@cosmjs/utils-cjs");
13
13
  const utils_1 = require("../utils");
14
+ /** Default extension key for resource-related query operations */
14
15
  exports.defaultResourceExtensionKey = 'resource';
16
+ /**
17
+ * Protobuf message type literals for resource operations.
18
+ * Used for consistent message type identification across the module.
19
+ */
15
20
  exports.protobufLiterals = {
21
+ /** Create resource message type */
16
22
  MsgCreateResource: 'MsgCreateResource',
23
+ /** Create resource response message type */
17
24
  MsgCreateResourceResponse: 'MsgCreateResourceResponse',
18
25
  };
26
+ /** Type URL for MsgCreateResource messages */
19
27
  exports.typeUrlMsgCreateResource = `/${v2_1.protobufPackage}.${exports.protobufLiterals.MsgCreateResource}`;
28
+ /** Type URL for MsgCreateResourceResponse messages */
20
29
  exports.typeUrlMsgCreateResourceResponse = `/${v2_1.protobufPackage}.${exports.protobufLiterals.MsgCreateResourceResponse}`;
30
+ /**
31
+ * Type guard function to check if an object is a MsgCreateResourceEncodeObject.
32
+ *
33
+ * @param obj - EncodeObject to check
34
+ * @returns True if the object is a MsgCreateResourceEncodeObject
35
+ */
21
36
  function isMsgCreateResourceEncodeObject(obj) {
22
37
  return obj.typeUrl === exports.typeUrlMsgCreateResource;
23
38
  }
39
+ /**
40
+ * Sets up the resource extension for the querier client.
41
+ * Creates and configures the resource-specific query methods.
42
+ *
43
+ * @param base - Base QueryClient to extend
44
+ * @returns Configured resource extension with query methods
45
+ */
24
46
  const setupResourceExtension = (base) => {
25
47
  const rpc = (0, stargate_cjs_1.createProtobufRpcClient)(base);
26
48
  const queryService = new v2_1.QueryClientImpl(rpc);
@@ -53,29 +75,50 @@ const setupResourceExtension = (base) => {
53
75
  };
54
76
  };
55
77
  exports.setupResourceExtension = setupResourceExtension;
78
+ /**
79
+ * Resource Module class providing comprehensive linked resource functionality.
80
+ * Handles creation, querying, and metadata management of resources linked to DID documents.
81
+ */
56
82
  class ResourceModule extends _1.AbstractCheqdSDKModule {
57
83
  //@ts-expect-error the underlying type is intentionally wider
58
84
  static registryTypes = [
59
85
  [exports.typeUrlMsgCreateResource, v2_1.MsgCreateResource],
60
86
  [exports.typeUrlMsgCreateResourceResponse, v2_1.MsgCreateResourceResponse],
61
87
  ];
88
+ /** Base denomination for Cheqd network transactions */
62
89
  static baseMinimalDenom = 'ncheq';
90
+ /**
91
+ * Standard fee amounts for different resource types.
92
+ * Fees vary based on resource content type and processing requirements.
93
+ */
63
94
  static fees = {
95
+ /** Default fee for creating image resources */
64
96
  DefaultCreateResourceImageFee: {
65
97
  amount: '10000000000',
66
98
  denom: ResourceModule.baseMinimalDenom,
67
99
  },
100
+ /** Default fee for creating JSON resources */
68
101
  DefaultCreateResourceJsonFee: {
69
102
  amount: '10000000000',
70
103
  denom: ResourceModule.baseMinimalDenom,
71
104
  },
105
+ /** Default fee for creating other types of resources */
72
106
  DefaultCreateResourceDefaultFee: {
73
107
  amount: '10000000000',
74
108
  denom: ResourceModule.baseMinimalDenom,
75
109
  },
76
110
  };
111
+ /** Querier extension setup function for resource operations */
77
112
  static querierExtensionSetup = exports.setupResourceExtension;
113
+ /** Querier instance with resource extension capabilities */
114
+ /** Querier instance with resource extension capabilities */
78
115
  querier;
116
+ /**
117
+ * Constructs a new resource module instance.
118
+ *
119
+ * @param signer - Signing client for blockchain transactions
120
+ * @param querier - Querier client with resource extension for data retrieval
121
+ */
79
122
  constructor(signer, querier) {
80
123
  super(signer, querier);
81
124
  this.querier = querier;
@@ -86,12 +129,30 @@ class ResourceModule extends _1.AbstractCheqdSDKModule {
86
129
  queryLinkedResources: this.queryLinkedResources.bind(this),
87
130
  };
88
131
  }
132
+ /**
133
+ * Gets the registry types for resource message encoding/decoding.
134
+ *
135
+ * @returns Iterable of [typeUrl, GeneratedType] pairs for the registry
136
+ */
89
137
  getRegistryTypes() {
90
138
  return ResourceModule.registryTypes;
91
139
  }
140
+ /**
141
+ * Gets the querier extension setup for resource operations.
142
+ *
143
+ * @returns Query extension setup function for resource functionality
144
+ */
92
145
  getQuerierExtensionSetup() {
93
146
  return ResourceModule.querierExtensionSetup;
94
147
  }
148
+ /**
149
+ * Signs a resource payload with provided signature inputs.
150
+ * Creates a complete signed resource message ready for blockchain submission.
151
+ *
152
+ * @param payload - Resource payload to sign
153
+ * @param signInputs - Signing inputs or pre-computed signatures
154
+ * @returns Promise resolving to the signed resource message
155
+ */
95
156
  static async signPayload(payload, signInputs) {
96
157
  const signBytes = v2_1.MsgCreateResourcePayload.encode(payload).finish();
97
158
  let signatures;
@@ -106,6 +167,19 @@ class ResourceModule extends _1.AbstractCheqdSDKModule {
106
167
  signatures,
107
168
  };
108
169
  }
170
+ /**
171
+ * Creates a linked resource transaction on the blockchain.
172
+ * Handles automatic fee calculation based on resource content type and size.
173
+ *
174
+ * @param signInputs - Signing inputs or pre-computed signatures for the transaction
175
+ * @param resourcePayload - Resource payload containing data and metadata
176
+ * @param address - Address of the account submitting the transaction
177
+ * @param fee - Transaction fee configuration or 'auto' for automatic calculation
178
+ * @param memo - Optional transaction memo
179
+ * @param context - Optional SDK context for accessing clients
180
+ * @returns Promise resolving to the transaction response
181
+ * @throws Error if linked resource data is empty when automatic fee calculation is requested
182
+ */
109
183
  async createLinkedResourceTx(signInputs, resourcePayload, address, fee, memo, context) {
110
184
  if (!this._signer) {
111
185
  this._signer = context.sdk.signer;
@@ -136,29 +210,70 @@ class ResourceModule extends _1.AbstractCheqdSDKModule {
136
210
  }
137
211
  return this._signer.signAndBroadcast(address, [encObj], fee, memo);
138
212
  }
213
+ /**
214
+ * Queries a specific linked resource by collection and resource ID.
215
+ * Retrieves the complete resource data along with its metadata.
216
+ *
217
+ * @param collectionId - ID of the collection containing the resource
218
+ * @param resourceId - ID of the resource to query
219
+ * @param context - Optional SDK context for accessing clients
220
+ * @returns Promise resolving to the resource with metadata
221
+ */
139
222
  async queryLinkedResource(collectionId, resourceId, context) {
140
223
  if (!this.querier) {
141
224
  this.querier = context.sdk.querier;
142
225
  }
143
226
  return await this.querier[exports.defaultResourceExtensionKey].resource(collectionId, resourceId);
144
227
  }
228
+ /**
229
+ * Queries metadata for a specific linked resource.
230
+ * Retrieves only the metadata without the resource content data.
231
+ *
232
+ * @param collectionId - ID of the collection containing the resource
233
+ * @param resourceId - ID of the resource to query metadata for
234
+ * @param context - Optional SDK context for accessing clients
235
+ * @returns Promise resolving to the resource metadata
236
+ */
145
237
  async queryLinkedResourceMetadata(collectionId, resourceId, context) {
146
238
  if (!this.querier) {
147
239
  this.querier = context.sdk.querier;
148
240
  }
149
241
  return await this.querier[exports.defaultResourceExtensionKey].resourceMetadata(collectionId, resourceId);
150
242
  }
243
+ /**
244
+ * Queries all resources in a collection with pagination support.
245
+ * Retrieves a list of all resources belonging to a specific collection.
246
+ *
247
+ * @param collectionId - ID of the collection to query resources for
248
+ * @param context - Optional SDK context for accessing clients
249
+ * @returns Promise resolving to the collection resources response with pagination
250
+ */
151
251
  async queryLinkedResources(collectionId, context) {
152
252
  if (!this.querier) {
153
253
  this.querier = context.sdk.querier;
154
254
  }
155
255
  return await this.querier[exports.defaultResourceExtensionKey].collectionResources(collectionId);
156
256
  }
257
+ /**
258
+ * Reads and determines the MIME type of resource content.
259
+ * Analyzes the content to identify the appropriate MIME type for fee calculation and validation.
260
+ *
261
+ * @param content - Resource content as byte array
262
+ * @returns Promise resolving to the detected MIME type string
263
+ */
157
264
  static async readMimeType(content) {
158
265
  if ((0, utils_1.isJSON)((0, uint8arrays_cjs_1.toString)(content, 'utf-8')))
159
266
  return 'application/json';
160
267
  return (await (0, browser_1.fromBuffer)(content))?.mime ?? 'application/octet-stream';
161
268
  }
269
+ /**
270
+ * Generates fee configuration for image resource creation transactions.
271
+ * Uses higher gas limits appropriate for image processing and storage.
272
+ *
273
+ * @param feePayer - Address of the account that will pay the transaction fees
274
+ * @param granter - Optional address of the account granting fee payment permissions
275
+ * @returns Promise resolving to the fee configuration for image resources
276
+ */
162
277
  static async generateCreateResourceImageFees(feePayer, granter) {
163
278
  return {
164
279
  amount: [ResourceModule.fees.DefaultCreateResourceImageFee],
@@ -167,6 +282,14 @@ class ResourceModule extends _1.AbstractCheqdSDKModule {
167
282
  granter: granter,
168
283
  };
169
284
  }
285
+ /**
286
+ * Generates fee configuration for JSON resource creation transactions.
287
+ * Uses gas limits optimized for JSON data processing and validation.
288
+ *
289
+ * @param feePayer - Address of the account that will pay the transaction fees
290
+ * @param granter - Optional address of the account granting fee payment permissions
291
+ * @returns Promise resolving to the fee configuration for JSON resources
292
+ */
170
293
  static async generateCreateResourceJsonFees(feePayer, granter) {
171
294
  return {
172
295
  amount: [ResourceModule.fees.DefaultCreateResourceJsonFee],
@@ -175,6 +298,14 @@ class ResourceModule extends _1.AbstractCheqdSDKModule {
175
298
  granter: granter,
176
299
  };
177
300
  }
301
+ /**
302
+ * Generates fee configuration for default resource creation transactions.
303
+ * Uses standard gas limits for generic resource types and binary data.
304
+ *
305
+ * @param feePayer - Address of the account that will pay the transaction fees
306
+ * @param granter - Optional address of the account granting fee payment permissions
307
+ * @returns Promise resolving to the fee configuration for default resources
308
+ */
178
309
  static async generateCreateResourceDefaultFees(feePayer, granter) {
179
310
  return {
180
311
  amount: [ResourceModule.fees.DefaultCreateResourceDefaultFee],
@@ -1 +1 @@
1
- {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../cjs/src/modules/resource.ts"],"names":[],"mappings":";;;AAuCA,0EAEC;AAzCD,0BAA8E;AAC9E,sCAAuD;AAEvD,oCAAiF;AACjF,8DAS+C;AAC/C,uDAAiH;AACjH,qDAA2C;AAC3C,mDAAmD;AAEnD,iDAA2C;AAG3C,oCAAkC;AAErB,QAAA,2BAA2B,GAAG,UAAmB,CAAC;AAElD,QAAA,gBAAgB,GAAG;IAC/B,iBAAiB,EAAE,mBAAmB;IACtC,yBAAyB,EAAE,2BAA2B;CAC7C,CAAC;AAEE,QAAA,wBAAwB,GAAG,IAAI,oBAAe,IAAI,wBAAgB,CAAC,iBAAiB,EAAW,CAAC;AAChG,QAAA,gCAAgC,GAC5C,IAAI,oBAAe,IAAI,wBA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;;;;OAMG;IACH,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAmB;QAC5C,IAAI,IAAA,cAAM,EAAC,IAAA,0BAAQ,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAAE,OAAO,kBAAkB,CAAC;QAClE,OAAO,CAAC,MAAM,IAAA,oBAAU,EAAC,OAAO,CAAC,CAAC,EAAE,IAAI,IAAI,0BAA0B,CAAC;IACxE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,QAAgB,EAAE,OAAgB;QAC9E,OAAO;YACN,MAAM,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,6BAA6B,CAAC;YAC3D,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,OAAO;SACH,CAAC;IAChB,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,QAAgB,EAAE,OAAgB;QAC7E,OAAO;YACN,MAAM,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,4BAA4B,CAAC;YAC1D,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,OAAO;SACH,CAAC;IAChB,CAAC;IAED;;;;;;;OAOG;IAEH,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,QAAgB,EAAE,OAAgB;QAChF,OAAO;YACN,MAAM,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,+BAA+B,CAAC;YAC7D,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,QAAQ;YACf,OAAO,EAAE,OAAO;SACH,CAAC;IAChB,CAAC;;AAtRF,wCAuRC"}
@@ -1,12 +1,62 @@
1
1
  import { QueryClient } from '@cosmjs/stargate-cjs';
2
2
  import { Tendermint34Client, Tendermint37Client, ConsensusParams } from '@cosmjs/tendermint-rpc-cjs';
3
3
  import { QueryExtensionSetup, CheqdExtensions } from './types';
4
+ /**
5
+ * Extended QueryClient specifically designed for the Cheqd blockchain network.
6
+ * Provides enhanced querying capabilities with support for custom extensions
7
+ * and consensus parameter retrieval.
8
+ */
4
9
  export declare class CheqdQuerier extends QueryClient {
10
+ /**
11
+ * Constructs a new CheqdQuerier instance with the provided Tendermint client.
12
+ *
13
+ * @param tmClient - Tendermint client (v34 or v37) for blockchain communication
14
+ */
5
15
  constructor(tmClient: Tendermint37Client | Tendermint34Client);
16
+ /**
17
+ * Retrieves the consensus parameters from the blockchain network.
18
+ * This method creates a temporary connection to fetch the latest block results
19
+ * and extract consensus update information.
20
+ *
21
+ * @param url - RPC URL of the blockchain node
22
+ * @returns Promise resolving to consensus parameters or undefined if not available
23
+ */
6
24
  static getConsensusParameters(url: string): Promise<ConsensusParams | undefined>;
25
+ /**
26
+ * Creates a new CheqdQuerier instance by establishing a connection to the specified RPC URL.
27
+ * This is the primary method for creating a querier instance for blockchain communication.
28
+ *
29
+ * @param url - RPC URL of the blockchain node to connect to
30
+ * @returns Promise resolving to a connected CheqdQuerier instance
31
+ */
7
32
  static connect(url: string): Promise<CheqdQuerier>;
33
+ /**
34
+ * Creates a CheqdQuerier instance from an existing Tendermint client.
35
+ * Useful when you already have an established client connection.
36
+ *
37
+ * @param client - Existing Tendermint client (v34 or v37)
38
+ * @returns Promise resolving to a CheqdQuerier instance using the provided client
39
+ */
8
40
  static fromClient(client: Tendermint34Client | Tendermint37Client): Promise<CheqdQuerier>;
41
+ /**
42
+ * Creates a CheqdQuerier instance with a single query extension.
43
+ * Extensions provide specialized query capabilities for specific blockchain modules.
44
+ *
45
+ * @param url - RPC URL of the blockchain node to connect to
46
+ * @param extension - Query extension setup to add specialized query functionality
47
+ * @returns Promise resolving to a CheqdQuerier instance with the specified extension
48
+ */
9
49
  static connectWithExtension(url: string, extension: QueryExtensionSetup<CheqdExtensions>): Promise<CheqdQuerier & CheqdExtensions>;
50
+ /**
51
+ * Creates a CheqdQuerier instance with multiple query extensions.
52
+ * This method supports adding multiple specialized query capabilities for different
53
+ * blockchain modules in a single operation. For single extensions, it delegates
54
+ * to connectWithExtension for efficiency.
55
+ *
56
+ * @param url - RPC URL of the blockchain node to connect to
57
+ * @param extensions - Variable number of query extension setups to add functionality
58
+ * @returns Promise resolving to a CheqdQuerier instance with all specified extensions
59
+ */
10
60
  static connectWithExtensions(url: string, ...extensions: QueryExtensionSetup<CheqdExtensions>[]): Promise<CheqdQuerier & CheqdExtensions>;
11
61
  }
12
62
  //# sourceMappingURL=querier.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"querier.d.ts","sourceRoot":"","sources":["../../cjs/src/querier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACrG,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/D,qBAAa,YAAa,SAAQ,WAAW;gBAChC,QAAQ,EAAE,kBAAkB,GAAG,kBAAkB;WAIhD,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;WAczE,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;WAK3C,UAAU,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;WAIlF,oBAAoB,CAChC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,mBAAmB,CAAC,eAAe,CAAC,GAC7C,OAAO,CAAC,YAAY,GAAG,eAAe,CAAC;WAK7B,qBAAqB,CACjC,GAAG,EAAE,MAAM,EACX,GAAG,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAAE,GACnD,OAAO,CAAC,YAAY,GAAG,eAAe,CAAC;CAc1C"}
1
+ {"version":3,"file":"querier.d.ts","sourceRoot":"","sources":["../../cjs/src/querier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACrG,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC5C;;;;OAIG;gBACS,QAAQ,EAAE,kBAAkB,GAAG,kBAAkB;IAI7D;;;;;;;OAOG;WACU,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IActF;;;;;;OAMG;WACU,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAKxD;;;;;;OAMG;WACU,UAAU,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAI/F;;;;;;;OAOG;WACU,oBAAoB,CAChC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,mBAAmB,CAAC,eAAe,CAAC,GAC7C,OAAO,CAAC,YAAY,GAAG,eAAe,CAAC;IAK1C;;;;;;;;;OASG;WACU,qBAAqB,CACjC,GAAG,EAAE,MAAM,EACX,GAAG,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,EAAE,GACnD,OAAO,CAAC,YAAY,GAAG,eAAe,CAAC;CAc1C"}
@@ -3,10 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CheqdQuerier = void 0;
4
4
  const stargate_cjs_1 = require("@cosmjs/stargate-cjs");
5
5
  const tendermint_rpc_cjs_1 = require("@cosmjs/tendermint-rpc-cjs");
6
+ /**
7
+ * Extended QueryClient specifically designed for the Cheqd blockchain network.
8
+ * Provides enhanced querying capabilities with support for custom extensions
9
+ * and consensus parameter retrieval.
10
+ */
6
11
  class CheqdQuerier extends stargate_cjs_1.QueryClient {
12
+ /**
13
+ * Constructs a new CheqdQuerier instance with the provided Tendermint client.
14
+ *
15
+ * @param tmClient - Tendermint client (v34 or v37) for blockchain communication
16
+ */
7
17
  constructor(tmClient) {
8
18
  super(tmClient);
9
19
  }
20
+ /**
21
+ * Retrieves the consensus parameters from the blockchain network.
22
+ * This method creates a temporary connection to fetch the latest block results
23
+ * and extract consensus update information.
24
+ *
25
+ * @param url - RPC URL of the blockchain node
26
+ * @returns Promise resolving to consensus parameters or undefined if not available
27
+ */
10
28
  static async getConsensusParameters(url) {
11
29
  // connect to comet rpc
12
30
  const cometClient = await tendermint_rpc_cjs_1.Tendermint37Client.connect(url);
@@ -17,17 +35,49 @@ class CheqdQuerier extends stargate_cjs_1.QueryClient {
17
35
  // return consensus parameters
18
36
  return result.consensusUpdates;
19
37
  }
38
+ /**
39
+ * Creates a new CheqdQuerier instance by establishing a connection to the specified RPC URL.
40
+ * This is the primary method for creating a querier instance for blockchain communication.
41
+ *
42
+ * @param url - RPC URL of the blockchain node to connect to
43
+ * @returns Promise resolving to a connected CheqdQuerier instance
44
+ */
20
45
  static async connect(url) {
21
46
  const tmClient = await tendermint_rpc_cjs_1.Tendermint37Client.connect(url);
22
47
  return new CheqdQuerier(tmClient);
23
48
  }
49
+ /**
50
+ * Creates a CheqdQuerier instance from an existing Tendermint client.
51
+ * Useful when you already have an established client connection.
52
+ *
53
+ * @param client - Existing Tendermint client (v34 or v37)
54
+ * @returns Promise resolving to a CheqdQuerier instance using the provided client
55
+ */
24
56
  static async fromClient(client) {
25
57
  return new CheqdQuerier(client);
26
58
  }
59
+ /**
60
+ * Creates a CheqdQuerier instance with a single query extension.
61
+ * Extensions provide specialized query capabilities for specific blockchain modules.
62
+ *
63
+ * @param url - RPC URL of the blockchain node to connect to
64
+ * @param extension - Query extension setup to add specialized query functionality
65
+ * @returns Promise resolving to a CheqdQuerier instance with the specified extension
66
+ */
27
67
  static async connectWithExtension(url, extension) {
28
68
  const tmClient = await tendermint_rpc_cjs_1.Tendermint37Client.connect(url);
29
69
  return CheqdQuerier.withExtensions(tmClient, extension);
30
70
  }
71
+ /**
72
+ * Creates a CheqdQuerier instance with multiple query extensions.
73
+ * This method supports adding multiple specialized query capabilities for different
74
+ * blockchain modules in a single operation. For single extensions, it delegates
75
+ * to connectWithExtension for efficiency.
76
+ *
77
+ * @param url - RPC URL of the blockchain node to connect to
78
+ * @param extensions - Variable number of query extension setups to add functionality
79
+ * @returns Promise resolving to a CheqdQuerier instance with all specified extensions
80
+ */
31
81
  static async connectWithExtensions(url, ...extensions) {
32
82
  if (extensions.length === 1) {
33
83
  return CheqdQuerier.connectWithExtension(url, extensions[0]);
@@ -1 +1 @@
1
- {"version":3,"file":"querier.js","sourceRoot":"","sources":["../../cjs/src/querier.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,mEAAqG;AAGrG,MAAa,YAAa,SAAQ,0BAAW;IAC5C,YAAY,QAAiD;QAC5D,KAAK,CAAC,QAAQ,CAAC,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,GAAW;QAC9C,uBAAuB;QACvB,MAAM,WAAW,GAAG,MAAM,uCAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAE1D,oBAAoB;QACpB,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,YAAY,EAAE,CAAC;QAEhD,0BAA0B;QAC1B,WAAW,CAAC,UAAU,EAAE,CAAC;QAEzB,8BAA8B;QAC9B,OAAO,MAAM,CAAC,gBAAgB,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAW;QAC/B,MAAM,QAAQ,GAAG,MAAM,uCAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACvD,OAAO,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAA+C;QACtE,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;I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