@cheqd/sdk-esm 5.3.4-develop.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 (68) hide show
  1. package/build/index.d.ts +140 -0
  2. package/build/index.d.ts.map +1 -0
  3. package/build/index.js +182 -0
  4. package/build/index.js.map +1 -0
  5. package/build/modules/_.d.ts +62 -0
  6. package/build/modules/_.d.ts.map +1 -0
  7. package/build/modules/_.js +75 -0
  8. package/build/modules/_.js.map +1 -0
  9. package/build/modules/did.d.ts +386 -0
  10. package/build/modules/did.d.ts.map +1 -0
  11. package/build/modules/did.js +1013 -0
  12. package/build/modules/did.js.map +1 -0
  13. package/build/modules/feeabstraction.d.ts +409 -0
  14. package/build/modules/feeabstraction.d.ts.map +1 -0
  15. package/build/modules/feeabstraction.js +462 -0
  16. package/build/modules/feeabstraction.js.map +1 -0
  17. package/build/modules/feemarket.d.ts +242 -0
  18. package/build/modules/feemarket.d.ts.map +1 -0
  19. package/build/modules/feemarket.js +296 -0
  20. package/build/modules/feemarket.js.map +1 -0
  21. package/build/modules/resource.d.ts +204 -0
  22. package/build/modules/resource.d.ts.map +1 -0
  23. package/build/modules/resource.js +297 -0
  24. package/build/modules/resource.js.map +1 -0
  25. package/build/package.json +64 -0
  26. package/build/querier.d.ts +62 -0
  27. package/build/querier.d.ts.map +1 -0
  28. package/build/querier.js +86 -0
  29. package/build/querier.js.map +1 -0
  30. package/build/registry.d.ts +18 -0
  31. package/build/registry.d.ts.map +1 -0
  32. package/build/registry.js +23 -0
  33. package/build/registry.js.map +1 -0
  34. package/build/signer.d.ts +190 -0
  35. package/build/signer.d.ts.map +1 -0
  36. package/build/signer.js +547 -0
  37. package/build/signer.js.map +1 -0
  38. package/build/types/index.d.ts +140 -0
  39. package/build/types/index.d.ts.map +1 -0
  40. package/build/types/modules/_.d.ts +62 -0
  41. package/build/types/modules/_.d.ts.map +1 -0
  42. package/build/types/modules/did.d.ts +386 -0
  43. package/build/types/modules/did.d.ts.map +1 -0
  44. package/build/types/modules/feeabstraction.d.ts +409 -0
  45. package/build/types/modules/feeabstraction.d.ts.map +1 -0
  46. package/build/types/modules/feemarket.d.ts +242 -0
  47. package/build/types/modules/feemarket.d.ts.map +1 -0
  48. package/build/types/modules/resource.d.ts +204 -0
  49. package/build/types/modules/resource.d.ts.map +1 -0
  50. package/build/types/querier.d.ts +62 -0
  51. package/build/types/querier.d.ts.map +1 -0
  52. package/build/types/registry.d.ts +18 -0
  53. package/build/types/registry.d.ts.map +1 -0
  54. package/build/types/signer.d.ts +190 -0
  55. package/build/types/signer.d.ts.map +1 -0
  56. package/build/types/types.d.ts +196 -0
  57. package/build/types/types.d.ts.map +1 -0
  58. package/build/types/utils.d.ts +223 -0
  59. package/build/types/utils.d.ts.map +1 -0
  60. package/build/types.d.ts +196 -0
  61. package/build/types.d.ts.map +1 -0
  62. package/build/types.js +43 -0
  63. package/build/types.js.map +1 -0
  64. package/build/utils.d.ts +223 -0
  65. package/build/utils.d.ts.map +1 -0
  66. package/build/utils.js +541 -0
  67. package/build/utils.js.map +1 -0
  68. package/package.json +64 -0
@@ -0,0 +1,242 @@
1
+ import { GasPriceResponse, GasPricesResponse, ParamsResponse } from '@cheqd/ts-proto/feemarket/feemarket/v1/index.js';
2
+ import { EncodeObject, GeneratedType } from '@cosmjs/proto-signing';
3
+ import { GasPrice, QueryClient } from '@cosmjs/stargate';
4
+ import { AbstractCheqdSDKModule, MinimalImportableCheqdSDKModule } from './_.js';
5
+ import { DidStdFee, IContext, QueryExtensionSetup } from '../types.js';
6
+ import { CheqdQuerier } from '../querier.js';
7
+ import { CheqdSigningStargateClient } from '../signer.js';
8
+ /** Default extension key for fee market-related query operations */
9
+ export declare const defaultFeemarketExtensionKey: "feemarket";
10
+ /**
11
+ * Protobuf message type literals for fee market operations.
12
+ * Used for consistent message type identification across the module.
13
+ */
14
+ export declare const protobufLiterals: {
15
+ /** Gas price response message type */
16
+ readonly GasPriceResponse: "GasPriceResponse";
17
+ /** Gas prices response message type */
18
+ readonly GasPricesResponse: "GasPricesResponse";
19
+ /** Parameters response message type */
20
+ readonly ParamsResponse: "ParamsResponse";
21
+ };
22
+ /** Type URL for GasPriceResponse messages */
23
+ export declare const typeUrlGasPriceResponse: "/feemarket.feemarket.v1.GasPriceResponse";
24
+ /** Type URL for GasPricesResponse messages */
25
+ export declare const typeUrlGasPricesResponse: "/feemarket.feemarket.v1.GasPricesResponse";
26
+ /** Type URL for ParamsResponse messages */
27
+ export declare const typeUrlParamsResponse: "/feemarket.feemarket.v1.ParamsResponse";
28
+ /**
29
+ * Default gas price tier names for fee calculation.
30
+ * Provides predefined tiers for different transaction priority levels.
31
+ */
32
+ export declare const defaultGasPriceTiers: {
33
+ /** Low priority tier with lowest gas prices */
34
+ readonly Low: "DefaultLowTier";
35
+ /** Average priority tier with moderate gas prices */
36
+ readonly Avg: "DefaultAvgTier";
37
+ /** High priority tier with highest gas prices */
38
+ readonly High: "DefaultHighTier";
39
+ };
40
+ /** Type representing the available default gas price tiers */
41
+ export type DefaultGasPriceTiers = (typeof defaultGasPriceTiers)[keyof typeof defaultGasPriceTiers];
42
+ /**
43
+ * Encode object interface for GasPriceResponse messages.
44
+ * Used for type-safe message encoding in gas price operations.
45
+ */
46
+ export interface GasPriceEncodeObject extends EncodeObject {
47
+ readonly typeUrl: typeof typeUrlGasPriceResponse;
48
+ readonly value: Partial<GasPriceResponse>;
49
+ }
50
+ /**
51
+ * Type guard function to check if an object is a GasPriceEncodeObject.
52
+ *
53
+ * @param obj - EncodeObject to check
54
+ * @returns True if the object is a GasPriceEncodeObject
55
+ */
56
+ export declare function isGasPriceEncodeObject(obj: EncodeObject): obj is GasPriceEncodeObject;
57
+ /**
58
+ * Encode object interface for GasPricesResponse messages.
59
+ * Used for type-safe message encoding in gas prices query operations.
60
+ */
61
+ export interface GasPricesEncodeObject extends EncodeObject {
62
+ readonly typeUrl: typeof typeUrlGasPricesResponse;
63
+ readonly value: Partial<GasPricesResponse>;
64
+ }
65
+ /**
66
+ * Type guard function to check if an object is a GasPricesEncodeObject.
67
+ *
68
+ * @param obj - EncodeObject to check
69
+ * @returns True if the object is a GasPricesEncodeObject
70
+ */
71
+ export declare function isGasPricesEncodeObject(obj: EncodeObject): obj is GasPricesEncodeObject;
72
+ /**
73
+ * Encode object interface for ParamsResponse messages.
74
+ * Used for type-safe message encoding in fee market parameters operations.
75
+ */
76
+ export interface ParamsEncodeObject extends EncodeObject {
77
+ readonly typeUrl: typeof typeUrlParamsResponse;
78
+ readonly value: Partial<ParamsResponse>;
79
+ }
80
+ /**
81
+ * Type guard function to check if an object is a ParamsEncodeObject.
82
+ *
83
+ * @param obj - EncodeObject to check
84
+ * @returns True if the object is a ParamsEncodeObject
85
+ */
86
+ export declare function isParamsEncodeObject(obj: EncodeObject): obj is ParamsEncodeObject;
87
+ /** Minimal importable version of the fee market module for clean external interfaces */
88
+ export type MinimalImportableFeemarketModule = MinimalImportableCheqdSDKModule<FeemarketModule>;
89
+ /**
90
+ * Fee market extension interface for querier functionality.
91
+ * Provides methods for querying gas prices and fee market parameters.
92
+ */
93
+ export type FeemarketExtension = {
94
+ readonly [defaultFeemarketExtensionKey]: {
95
+ /** Query gas price for a specific denomination */
96
+ readonly gasPrice: (denom: string) => Promise<GasPriceResponse>;
97
+ /** Query all available gas prices */
98
+ readonly gasPrices: () => Promise<GasPricesResponse>;
99
+ /** Query fee market module parameters */
100
+ readonly params: () => Promise<ParamsResponse>;
101
+ };
102
+ };
103
+ /**
104
+ * Sets up the fee market extension for the querier client.
105
+ * Creates and configures the fee market-specific query methods.
106
+ *
107
+ * @param base - Base QueryClient to extend
108
+ * @returns Configured fee market extension with query methods
109
+ */
110
+ export declare const setupFeemarketExtension: (base: QueryClient) => FeemarketExtension;
111
+ /**
112
+ * Fee Market Module class providing comprehensive fee market functionality.
113
+ * Handles gas price queries, dynamic fee calculation, and fee market parameter management.
114
+ */
115
+ export declare class FeemarketModule extends AbstractCheqdSDKModule {
116
+ static readonly registryTypes: Iterable<[string, GeneratedType]>;
117
+ /**
118
+ * Default gas prices for different priority tiers.
119
+ * Used as fallback when live gas price queries are unavailable.
120
+ */
121
+ static readonly defaultGasPrices: {
122
+ readonly DefaultLowTier: {
123
+ readonly amount: "5000";
124
+ readonly denom: "ncheq";
125
+ };
126
+ readonly DefaultAvgTier: {
127
+ readonly amount: "7500";
128
+ readonly denom: "ncheq";
129
+ };
130
+ readonly DefaultHighTier: {
131
+ readonly amount: "10000";
132
+ readonly denom: "ncheq";
133
+ };
134
+ };
135
+ /** Gas offset factor used for adjusting live gas prices */
136
+ static readonly gasOffsetFactor: number;
137
+ /** Address of the fee collector account that receives transaction fees */
138
+ static readonly feeCollectorAddress: "cheqd13pxn9n3qw79e03844rdadagmg0nshmwfszqu0g";
139
+ /** Address of the fee market module account */
140
+ static readonly moduleAccountAddress: "cheqd1el68mjnzv87uurqks8u29tec0cj3297047g2dl";
141
+ /** Querier extension setup function for fee market operations */
142
+ static readonly querierExtensionSetup: QueryExtensionSetup<FeemarketExtension>;
143
+ /** Querier instance with fee market extension capabilities */
144
+ querier: CheqdQuerier & FeemarketExtension;
145
+ /**
146
+ * Constructs a new fee market module instance.
147
+ *
148
+ * @param signer - Signing client for blockchain transactions
149
+ * @param querier - Querier client with fee market extension for data retrieval
150
+ */
151
+ constructor(signer: CheqdSigningStargateClient, querier: CheqdQuerier & FeemarketExtension);
152
+ /**
153
+ * Gets the registry types for fee market message encoding/decoding.
154
+ *
155
+ * @returns Iterable of [typeUrl, GeneratedType] pairs for the registry
156
+ */
157
+ getRegistryTypes(): Iterable<[string, GeneratedType]>;
158
+ /**
159
+ * Gets the querier extension setup for fee market operations.
160
+ *
161
+ * @returns Query extension setup function for fee market functionality
162
+ */
163
+ getQuerierExtensionSetup(): QueryExtensionSetup<FeemarketExtension>;
164
+ /**
165
+ * Queries the current gas price for a specific denomination.
166
+ * Retrieves live gas price data from the fee market module.
167
+ *
168
+ * @param denom - Token denomination to query gas price for
169
+ * @param context - Optional SDK context for accessing clients
170
+ * @returns Promise resolving to the gas price response
171
+ */
172
+ queryGasPrice(denom: string, context?: IContext): Promise<GasPriceResponse>;
173
+ /**
174
+ * Queries all available gas prices from the fee market.
175
+ * Retrieves comprehensive gas pricing information for all denominations.
176
+ *
177
+ * @param context - Optional SDK context for accessing clients
178
+ * @returns Promise resolving to the gas prices response
179
+ */
180
+ queryGasPrices(context?: IContext): Promise<GasPricesResponse>;
181
+ /**
182
+ * Queries the fee market module parameters.
183
+ * Retrieves configuration settings for the fee market functionality.
184
+ *
185
+ * @param context - Optional SDK context for accessing clients
186
+ * @returns Promise resolving to the parameters response
187
+ */
188
+ queryParams(context?: IContext): Promise<ParamsResponse>;
189
+ /**
190
+ * Generates gas price for a denomination by live polling the fee market.
191
+ * Queries current gas prices and adjusts them using the gas offset factor.
192
+ * Throws an error if live polling fails.
193
+ *
194
+ * @param denom - Token denomination to generate gas price for
195
+ * @param context - Optional SDK context for accessing clients
196
+ * @returns Promise resolving to the calculated gas price
197
+ * @throws Error if live poll for gas price fails or returns invalid data
198
+ */
199
+ generateGasPrice(denom: string, context?: IContext): Promise<GasPrice>;
200
+ /**
201
+ * Generates offline gas price for a denomination using static tier pricing.
202
+ * Uses predefined gas prices as fallback when live polling is unavailable.
203
+ *
204
+ * @param denom - Token denomination to generate gas price for
205
+ * @param tier - Priority tier for gas price calculation (defaults to Low)
206
+ * @returns Promise resolving to the static gas price
207
+ * @throws Error if denomination or tier is invalid
208
+ */
209
+ generateOfflineGasPrice(denom: string, tier?: DefaultGasPriceTiers): Promise<GasPrice>;
210
+ /**
211
+ * Generates safe gas price with automatic fallback to offline pricing.
212
+ * Attempts live polling first, falls back to static tier pricing if it fails.
213
+ *
214
+ * @param denom - Token denomination to generate gas price for
215
+ * @param tier - Priority tier for fallback gas price calculation (defaults to Low)
216
+ * @param context - Optional SDK context for accessing clients
217
+ * @returns Promise resolving to the gas price (live or fallback)
218
+ */
219
+ generateSafeGasPrice(denom: string, tier?: DefaultGasPriceTiers, context?: IContext): Promise<GasPrice>;
220
+ /**
221
+ * Generates safe gas price with exponential backoff retry mechanism.
222
+ * Retries live polling with exponential backoff before falling back to offline pricing.
223
+ *
224
+ * @param denom - Token denomination to generate gas price for
225
+ * @param tier - Priority tier for fallback gas price calculation (defaults to Low)
226
+ * @param backoffOptions - Retry configuration options (defaults to DefaultBackoffOptions)
227
+ * @param context - Optional SDK context for accessing clients
228
+ * @returns Promise resolving to the gas price (live with retries or fallback)
229
+ */
230
+ generateSafeGasPriceWithExponentialBackoff(denom: string, tier?: DefaultGasPriceTiers, backoffOptions?: Partial<import("exponential-backoff").IBackOffOptions>, context?: IContext): Promise<GasPrice>;
231
+ /**
232
+ * Generates transaction fees from a given gas price.
233
+ * Calculates the total fee amount based on gas price and gas limit.
234
+ *
235
+ * @param gasPrice - Gas price to use for fee calculation
236
+ * @param payer - Address of the account paying the transaction fees
237
+ * @param gas - Gas limit for the transaction (defaults to '200000')
238
+ * @returns Standard fee configuration for the transaction
239
+ */
240
+ static generateFeesFromGasPrice(gasPrice: GasPrice, payer: string, gas?: string): DidStdFee;
241
+ }
242
+ //# sourceMappingURL=feemarket.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feemarket.d.ts","sourceRoot":"","sources":["../../src/modules/feemarket.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EAGd,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAA2B,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,MAAM,QAAQ,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE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AE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAW,GAAG,SAAS;CAO7F"}
@@ -0,0 +1,296 @@
1
+ import { GasPriceResponse, GasPricesResponse, ParamsResponse, QueryClientImpl, protobufPackage, } from '@cheqd/ts-proto/feemarket/feemarket/v1/index.js';
2
+ import { createProtobufRpcClient, GasPrice } from '@cosmjs/stargate';
3
+ import { AbstractCheqdSDKModule } from './_.js';
4
+ import { DefaultBackoffOptions, retry } from '../utils.js';
5
+ import { Decimal, Uint32 } from '@cosmjs/math';
6
+ /** Default extension key for fee market-related query operations */
7
+ export const defaultFeemarketExtensionKey = 'feemarket';
8
+ /**
9
+ * Protobuf message type literals for fee market operations.
10
+ * Used for consistent message type identification across the module.
11
+ */
12
+ export const protobufLiterals = {
13
+ /** Gas price response message type */
14
+ GasPriceResponse: 'GasPriceResponse',
15
+ /** Gas prices response message type */
16
+ GasPricesResponse: 'GasPricesResponse',
17
+ /** Parameters response message type */
18
+ ParamsResponse: 'ParamsResponse',
19
+ };
20
+ /** Type URL for GasPriceResponse messages */
21
+ export const typeUrlGasPriceResponse = `/${protobufPackage}.${protobufLiterals.GasPriceResponse}`;
22
+ /** Type URL for GasPricesResponse messages */
23
+ export const typeUrlGasPricesResponse = `/${protobufPackage}.${protobufLiterals.GasPricesResponse}`;
24
+ /** Type URL for ParamsResponse messages */
25
+ export const typeUrlParamsResponse = `/${protobufPackage}.${protobufLiterals.ParamsResponse}`;
26
+ /**
27
+ * Default gas price tier names for fee calculation.
28
+ * Provides predefined tiers for different transaction priority levels.
29
+ */
30
+ export const defaultGasPriceTiers = {
31
+ /** Low priority tier with lowest gas prices */
32
+ Low: 'DefaultLowTier',
33
+ /** Average priority tier with moderate gas prices */
34
+ Avg: 'DefaultAvgTier',
35
+ /** High priority tier with highest gas prices */
36
+ High: 'DefaultHighTier',
37
+ };
38
+ /**
39
+ * Type guard function to check if an object is a GasPriceEncodeObject.
40
+ *
41
+ * @param obj - EncodeObject to check
42
+ * @returns True if the object is a GasPriceEncodeObject
43
+ */
44
+ export function isGasPriceEncodeObject(obj) {
45
+ return obj.typeUrl === typeUrlGasPriceResponse;
46
+ }
47
+ /**
48
+ * Type guard function to check if an object is a GasPricesEncodeObject.
49
+ *
50
+ * @param obj - EncodeObject to check
51
+ * @returns True if the object is a GasPricesEncodeObject
52
+ */
53
+ export function isGasPricesEncodeObject(obj) {
54
+ return obj.typeUrl === typeUrlGasPricesResponse;
55
+ }
56
+ /**
57
+ * Type guard function to check if an object is a ParamsEncodeObject.
58
+ *
59
+ * @param obj - EncodeObject to check
60
+ * @returns True if the object is a ParamsEncodeObject
61
+ */
62
+ export function isParamsEncodeObject(obj) {
63
+ return obj.typeUrl === typeUrlParamsResponse;
64
+ }
65
+ /**
66
+ * Sets up the fee market extension for the querier client.
67
+ * Creates and configures the fee market-specific query methods.
68
+ *
69
+ * @param base - Base QueryClient to extend
70
+ * @returns Configured fee market extension with query methods
71
+ */
72
+ export const setupFeemarketExtension = (base) => {
73
+ const rpc = createProtobufRpcClient(base);
74
+ const queryService = new QueryClientImpl(rpc);
75
+ return {
76
+ [defaultFeemarketExtensionKey]: {
77
+ gasPrice: async (denom) => {
78
+ return queryService.GasPrice({ denom });
79
+ },
80
+ gasPrices: async () => {
81
+ return queryService.GasPrices({});
82
+ },
83
+ params: async () => {
84
+ return queryService.Params({});
85
+ },
86
+ },
87
+ };
88
+ };
89
+ /**
90
+ * Fee Market Module class providing comprehensive fee market functionality.
91
+ * Handles gas price queries, dynamic fee calculation, and fee market parameter management.
92
+ */
93
+ export class FeemarketModule extends AbstractCheqdSDKModule {
94
+ // @ts-expect-error underlying type `GeneratedType` is intentionally wider
95
+ static registryTypes = [
96
+ [typeUrlGasPriceResponse, GasPriceResponse],
97
+ [typeUrlGasPricesResponse, GasPricesResponse],
98
+ [typeUrlParamsResponse, ParamsResponse],
99
+ ];
100
+ /**
101
+ * Default gas prices for different priority tiers.
102
+ * Used as fallback when live gas price queries are unavailable.
103
+ */
104
+ static defaultGasPrices = {
105
+ [defaultGasPriceTiers.Low]: { amount: '5000', denom: 'ncheq' },
106
+ [defaultGasPriceTiers.Avg]: { amount: '7500', denom: 'ncheq' },
107
+ [defaultGasPriceTiers.High]: { amount: '10000', denom: 'ncheq' },
108
+ };
109
+ /** Gas offset factor used for adjusting live gas prices */
110
+ static gasOffsetFactor = 10 ** 4;
111
+ /** Address of the fee collector account that receives transaction fees */
112
+ static feeCollectorAddress = 'cheqd13pxn9n3qw79e03844rdadagmg0nshmwfszqu0g';
113
+ /** Address of the fee market module account */
114
+ static moduleAccountAddress = 'cheqd1el68mjnzv87uurqks8u29tec0cj3297047g2dl';
115
+ /** Querier extension setup function for fee market operations */
116
+ static querierExtensionSetup = setupFeemarketExtension;
117
+ /** Querier instance with fee market extension capabilities */
118
+ querier;
119
+ /**
120
+ * Constructs a new fee market module instance.
121
+ *
122
+ * @param signer - Signing client for blockchain transactions
123
+ * @param querier - Querier client with fee market extension for data retrieval
124
+ */
125
+ constructor(signer, querier) {
126
+ super(signer, querier);
127
+ this.querier = querier;
128
+ this.methods = {
129
+ queryGasPrice: this.queryGasPrice.bind(this),
130
+ queryGasPrices: this.queryGasPrices.bind(this),
131
+ queryParams: this.queryParams.bind(this),
132
+ generateGasPrice: this.generateGasPrice.bind(this),
133
+ generateOfflineGasPrice: this.generateOfflineGasPrice.bind(this),
134
+ generateSafeGasPrice: this.generateSafeGasPrice.bind(this),
135
+ generateSafeGasPriceWithExponentialBackoff: this.generateSafeGasPriceWithExponentialBackoff.bind(this),
136
+ };
137
+ }
138
+ /**
139
+ * Gets the registry types for fee market message encoding/decoding.
140
+ *
141
+ * @returns Iterable of [typeUrl, GeneratedType] pairs for the registry
142
+ */
143
+ getRegistryTypes() {
144
+ return FeemarketModule.registryTypes;
145
+ }
146
+ /**
147
+ * Gets the querier extension setup for fee market operations.
148
+ *
149
+ * @returns Query extension setup function for fee market functionality
150
+ */
151
+ getQuerierExtensionSetup() {
152
+ return FeemarketModule.querierExtensionSetup;
153
+ }
154
+ /**
155
+ * Queries the current gas price for a specific denomination.
156
+ * Retrieves live gas price data from the fee market module.
157
+ *
158
+ * @param denom - Token denomination to query gas price for
159
+ * @param context - Optional SDK context for accessing clients
160
+ * @returns Promise resolving to the gas price response
161
+ */
162
+ async queryGasPrice(denom, context) {
163
+ if (!this.querier)
164
+ this.querier = context.sdk.querier;
165
+ return this.querier[defaultFeemarketExtensionKey].gasPrice(denom);
166
+ }
167
+ /**
168
+ * Queries all available gas prices from the fee market.
169
+ * Retrieves comprehensive gas pricing information for all denominations.
170
+ *
171
+ * @param context - Optional SDK context for accessing clients
172
+ * @returns Promise resolving to the gas prices response
173
+ */
174
+ async queryGasPrices(context) {
175
+ if (!this.querier)
176
+ this.querier = context.sdk.querier;
177
+ return this.querier[defaultFeemarketExtensionKey].gasPrices();
178
+ }
179
+ /**
180
+ * Queries the fee market module parameters.
181
+ * Retrieves configuration settings for the fee market functionality.
182
+ *
183
+ * @param context - Optional SDK context for accessing clients
184
+ * @returns Promise resolving to the parameters response
185
+ */
186
+ async queryParams(context) {
187
+ if (!this.querier)
188
+ this.querier = context.sdk.querier;
189
+ return this.querier[defaultFeemarketExtensionKey].params();
190
+ }
191
+ /**
192
+ * Generates gas price for a denomination by live polling the fee market.
193
+ * Queries current gas prices and adjusts them using the gas offset factor.
194
+ * Throws an error if live polling fails.
195
+ *
196
+ * @param denom - Token denomination to generate gas price for
197
+ * @param context - Optional SDK context for accessing clients
198
+ * @returns Promise resolving to the calculated gas price
199
+ * @throws Error if live poll for gas price fails or returns invalid data
200
+ */
201
+ async generateGasPrice(denom, context) {
202
+ if (!this.querier)
203
+ this.querier = context.sdk.querier;
204
+ // query gas price, bubble up error, no catch
205
+ const gasPrice = await this.queryGasPrice(denom, context);
206
+ // validate gas price
207
+ if (!gasPrice.price)
208
+ throw new Error('Invalid gas price: live poll for gas price failed');
209
+ // convert gas price through offset factor
210
+ const adjustedGasPrice = Decimal.fromAtomics(gasPrice.price.amount, 18)
211
+ .multiply(Uint32.fromString(FeemarketModule.gasOffsetFactor.toString()))
212
+ .toString();
213
+ // safe convert gas price to string
214
+ return GasPrice.fromString(`${adjustedGasPrice}${gasPrice.price.denom}`);
215
+ }
216
+ /**
217
+ * Generates offline gas price for a denomination using static tier pricing.
218
+ * Uses predefined gas prices as fallback when live polling is unavailable.
219
+ *
220
+ * @param denom - Token denomination to generate gas price for
221
+ * @param tier - Priority tier for gas price calculation (defaults to Low)
222
+ * @returns Promise resolving to the static gas price
223
+ * @throws Error if denomination or tier is invalid
224
+ */
225
+ async generateOfflineGasPrice(denom, tier = defaultGasPriceTiers.Low) {
226
+ // validate denom against default
227
+ if (!Object.values(FeemarketModule.defaultGasPrices).some((gp) => gp.denom === denom))
228
+ throw new Error(`Invalid denom: ${denom}`);
229
+ // validate tier against default
230
+ if (!Object.keys(FeemarketModule.defaultGasPrices).includes(tier))
231
+ throw new Error(`Invalid tier: ${tier}`);
232
+ // generate gas price
233
+ const gasPrice = FeemarketModule.defaultGasPrices[tier];
234
+ // safe convert gas price to string
235
+ return GasPrice.fromString(`${gasPrice.amount}${gasPrice.denom}`);
236
+ }
237
+ /**
238
+ * Generates safe gas price with automatic fallback to offline pricing.
239
+ * Attempts live polling first, falls back to static tier pricing if it fails.
240
+ *
241
+ * @param denom - Token denomination to generate gas price for
242
+ * @param tier - Priority tier for fallback gas price calculation (defaults to Low)
243
+ * @param context - Optional SDK context for accessing clients
244
+ * @returns Promise resolving to the gas price (live or fallback)
245
+ */
246
+ async generateSafeGasPrice(denom, tier = defaultGasPriceTiers.Low, context) {
247
+ if (!this.querier)
248
+ this.querier = context.sdk.querier;
249
+ try {
250
+ // generate gas price
251
+ return await this.generateGasPrice(denom, context);
252
+ }
253
+ catch (error) {
254
+ // generate offline gas price
255
+ return await this.generateOfflineGasPrice(denom, tier);
256
+ }
257
+ }
258
+ /**
259
+ * Generates safe gas price with exponential backoff retry mechanism.
260
+ * Retries live polling with exponential backoff before falling back to offline pricing.
261
+ *
262
+ * @param denom - Token denomination to generate gas price for
263
+ * @param tier - Priority tier for fallback gas price calculation (defaults to Low)
264
+ * @param backoffOptions - Retry configuration options (defaults to DefaultBackoffOptions)
265
+ * @param context - Optional SDK context for accessing clients
266
+ * @returns Promise resolving to the gas price (live with retries or fallback)
267
+ */
268
+ async generateSafeGasPriceWithExponentialBackoff(denom, tier = defaultGasPriceTiers.Low, backoffOptions = DefaultBackoffOptions, context) {
269
+ if (!this.querier)
270
+ this.querier = context.sdk.querier;
271
+ // live poll for gas price
272
+ const gasPrice = await retry(() => this.generateGasPrice(denom, context), backoffOptions);
273
+ // return, if applicable
274
+ if (gasPrice)
275
+ return gasPrice;
276
+ // otherwise, generate offline gas price
277
+ return await this.generateOfflineGasPrice(denom, tier);
278
+ }
279
+ /**
280
+ * Generates transaction fees from a given gas price.
281
+ * Calculates the total fee amount based on gas price and gas limit.
282
+ *
283
+ * @param gasPrice - Gas price to use for fee calculation
284
+ * @param payer - Address of the account paying the transaction fees
285
+ * @param gas - Gas limit for the transaction (defaults to '200000')
286
+ * @returns Standard fee configuration for the transaction
287
+ */
288
+ static generateFeesFromGasPrice(gasPrice, payer, gas = '200000') {
289
+ return {
290
+ amount: [{ denom: gasPrice.denom, amount: gasPrice.amount.multiply(Uint32.fromString(gas)).toString() }],
291
+ gas,
292
+ payer,
293
+ };
294
+ }
295
+ }
296
+ //# sourceMappingURL=feemarket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feemarket.js","sourceRoot":"","sources":["../../src/modules/feemarket.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,eAAe,GACf,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAe,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAmC,MAAM,QAAQ,CAAC;AAIjF,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAA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