@cheqd/sdk-esm 5.3.7-develop.1 → 5.4.0-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.
- package/build/cjs/src/index.d.ts +142 -0
- package/build/cjs/src/index.d.ts.map +1 -0
- package/build/cjs/src/index.js +184 -0
- package/build/cjs/src/index.js.map +1 -0
- package/build/cjs/src/modules/_.d.ts +81 -0
- package/build/cjs/src/modules/_.d.ts.map +1 -0
- package/build/cjs/src/modules/_.js +93 -0
- package/build/cjs/src/modules/_.js.map +1 -0
- package/build/cjs/src/modules/did.d.ts +488 -0
- package/build/cjs/src/modules/did.d.ts.map +1 -0
- package/build/cjs/src/modules/did.js +1249 -0
- package/build/cjs/src/modules/did.js.map +1 -0
- package/build/cjs/src/modules/feeabstraction.d.ts +429 -0
- package/build/cjs/src/modules/feeabstraction.d.ts.map +1 -0
- package/build/cjs/src/modules/feeabstraction.js +474 -0
- package/build/cjs/src/modules/feeabstraction.js.map +1 -0
- package/build/cjs/src/modules/feemarket.d.ts +244 -0
- package/build/cjs/src/modules/feemarket.d.ts.map +1 -0
- package/build/cjs/src/modules/feemarket.js +297 -0
- package/build/cjs/src/modules/feemarket.js.map +1 -0
- package/build/cjs/src/modules/oracle.d.ts +563 -0
- package/build/cjs/src/modules/oracle.d.ts.map +1 -0
- package/build/cjs/src/modules/oracle.js +784 -0
- package/build/cjs/src/modules/oracle.js.map +1 -0
- package/build/cjs/src/modules/resource.d.ts +330 -0
- package/build/cjs/src/modules/resource.d.ts.map +1 -0
- package/build/cjs/src/modules/resource.js +556 -0
- package/build/cjs/src/modules/resource.js.map +1 -0
- package/build/cjs/src/querier.d.ts +62 -0
- package/build/cjs/src/querier.d.ts.map +1 -0
- package/build/cjs/src/querier.js +87 -0
- package/build/cjs/src/querier.js.map +1 -0
- package/build/cjs/src/registry.d.ts +18 -0
- package/build/cjs/src/registry.d.ts.map +1 -0
- package/build/cjs/src/registry.js +23 -0
- package/build/cjs/src/registry.js.map +1 -0
- package/build/cjs/src/signer.d.ts +250 -0
- package/build/cjs/src/signer.d.ts.map +1 -0
- package/build/cjs/src/signer.js +617 -0
- package/build/cjs/src/signer.js.map +1 -0
- package/build/cjs/src/types.d.ts +221 -0
- package/build/cjs/src/types.d.ts.map +1 -0
- package/build/cjs/src/types.js.map +1 -0
- package/build/cjs/src/utils.d.ts +233 -0
- package/build/cjs/src/utils.d.ts.map +1 -0
- package/build/cjs/src/utils.js +571 -0
- package/build/cjs/src/utils.js.map +1 -0
- package/build/{index.d.ts → esm/src/index.d.ts} +7 -3
- package/build/esm/src/index.d.ts.map +1 -0
- package/build/{index.js → esm/src/index.js} +3 -1
- package/build/esm/src/index.js.map +1 -0
- package/build/esm/src/modules/_.d.ts.map +1 -0
- package/build/esm/src/modules/_.js.map +1 -0
- package/build/{modules → esm/src/modules}/did.d.ts +109 -7
- package/build/esm/src/modules/did.d.ts.map +1 -0
- package/build/{modules → esm/src/modules}/did.js +212 -6
- package/build/esm/src/modules/did.js.map +1 -0
- package/build/esm/src/modules/feeabstraction.d.ts.map +1 -0
- package/build/esm/src/modules/feeabstraction.js.map +1 -0
- package/build/esm/src/modules/feemarket.d.ts.map +1 -0
- package/build/esm/src/modules/feemarket.js.map +1 -0
- package/build/esm/src/modules/oracle.d.ts +563 -0
- package/build/esm/src/modules/oracle.d.ts.map +1 -0
- package/build/esm/src/modules/oracle.js +784 -0
- package/build/esm/src/modules/oracle.js.map +1 -0
- package/build/{modules → esm/src/modules}/resource.d.ts +132 -6
- package/build/esm/src/modules/resource.d.ts.map +1 -0
- package/build/esm/src/modules/resource.js +556 -0
- package/build/esm/src/modules/resource.js.map +1 -0
- package/build/esm/src/querier.d.ts.map +1 -0
- package/build/esm/src/querier.js.map +1 -0
- package/build/esm/src/registry.d.ts.map +1 -0
- package/build/esm/src/registry.js.map +1 -0
- package/build/esm/src/signer.d.ts.map +1 -0
- package/build/esm/src/signer.js.map +1 -0
- package/build/{types → esm/src}/types.d.ts +27 -1
- package/build/esm/src/types.d.ts.map +1 -0
- package/build/esm/src/types.js +43 -0
- package/build/esm/src/types.js.map +1 -0
- package/build/esm/src/utils.d.ts.map +1 -0
- package/build/esm/src/utils.js.map +1 -0
- package/build/types/cjs/src/index.d.ts +142 -0
- package/build/types/cjs/src/index.d.ts.map +1 -0
- package/build/types/cjs/src/modules/_.d.ts +81 -0
- package/build/types/cjs/src/modules/_.d.ts.map +1 -0
- package/build/types/cjs/src/modules/did.d.ts +488 -0
- package/build/types/cjs/src/modules/did.d.ts.map +1 -0
- package/build/types/cjs/src/modules/feeabstraction.d.ts +429 -0
- package/build/types/cjs/src/modules/feeabstraction.d.ts.map +1 -0
- package/build/types/cjs/src/modules/feemarket.d.ts +244 -0
- package/build/types/cjs/src/modules/feemarket.d.ts.map +1 -0
- package/build/types/cjs/src/modules/oracle.d.ts +563 -0
- package/build/types/cjs/src/modules/oracle.d.ts.map +1 -0
- package/build/types/cjs/src/modules/resource.d.ts +330 -0
- package/build/types/cjs/src/modules/resource.d.ts.map +1 -0
- package/build/types/cjs/src/querier.d.ts +62 -0
- package/build/types/cjs/src/querier.d.ts.map +1 -0
- package/build/types/cjs/src/registry.d.ts +18 -0
- package/build/types/cjs/src/registry.d.ts.map +1 -0
- package/build/types/cjs/src/signer.d.ts +250 -0
- package/build/types/cjs/src/signer.d.ts.map +1 -0
- package/build/types/cjs/src/types.d.ts +221 -0
- package/build/types/cjs/src/types.d.ts.map +1 -0
- package/build/types/cjs/src/utils.d.ts +233 -0
- package/build/types/cjs/src/utils.d.ts.map +1 -0
- package/build/types/{index.d.ts → esm/src/index.d.ts} +7 -3
- package/build/types/esm/src/index.d.ts.map +1 -0
- package/build/types/esm/src/modules/_.d.ts.map +1 -0
- package/build/types/{modules → esm/src/modules}/did.d.ts +109 -7
- package/build/types/esm/src/modules/did.d.ts.map +1 -0
- package/build/types/esm/src/modules/feeabstraction.d.ts.map +1 -0
- package/build/types/esm/src/modules/feemarket.d.ts.map +1 -0
- package/build/types/esm/src/modules/oracle.d.ts +563 -0
- package/build/types/esm/src/modules/oracle.d.ts.map +1 -0
- package/build/types/{modules → esm/src/modules}/resource.d.ts +132 -6
- package/build/types/esm/src/modules/resource.d.ts.map +1 -0
- package/build/types/esm/src/querier.d.ts.map +1 -0
- package/build/types/esm/src/registry.d.ts.map +1 -0
- package/build/types/esm/src/signer.d.ts.map +1 -0
- package/build/{types.d.ts → types/esm/src/types.d.ts} +27 -1
- package/build/types/esm/src/types.d.ts.map +1 -0
- package/build/types/esm/src/utils.d.ts.map +1 -0
- package/package.json +2 -2
- package/build/index.d.ts.map +0 -1
- package/build/index.js.map +0 -1
- package/build/modules/_.d.ts.map +0 -1
- package/build/modules/_.js.map +0 -1
- package/build/modules/did.d.ts.map +0 -1
- package/build/modules/did.js.map +0 -1
- package/build/modules/feeabstraction.d.ts.map +0 -1
- package/build/modules/feeabstraction.js.map +0 -1
- package/build/modules/feemarket.d.ts.map +0 -1
- package/build/modules/feemarket.js.map +0 -1
- package/build/modules/resource.d.ts.map +0 -1
- package/build/modules/resource.js +0 -297
- package/build/modules/resource.js.map +0 -1
- package/build/querier.d.ts.map +0 -1
- package/build/querier.js.map +0 -1
- package/build/registry.d.ts.map +0 -1
- package/build/registry.js.map +0 -1
- package/build/signer.d.ts.map +0 -1
- package/build/signer.js.map +0 -1
- package/build/types/index.d.ts.map +0 -1
- package/build/types/modules/_.d.ts.map +0 -1
- package/build/types/modules/did.d.ts.map +0 -1
- package/build/types/modules/feeabstraction.d.ts.map +0 -1
- package/build/types/modules/feemarket.d.ts.map +0 -1
- package/build/types/modules/resource.d.ts.map +0 -1
- package/build/types/querier.d.ts.map +0 -1
- package/build/types/registry.d.ts.map +0 -1
- package/build/types/signer.d.ts.map +0 -1
- package/build/types/types.d.ts.map +0 -1
- package/build/types/utils.d.ts.map +0 -1
- package/build/types.d.ts.map +0 -1
- package/build/types.js.map +0 -1
- package/build/utils.d.ts.map +0 -1
- package/build/utils.js.map +0 -1
- /package/build/{types.js → cjs/src/types.js} +0 -0
- /package/build/{modules → esm/src/modules}/_.d.ts +0 -0
- /package/build/{modules → esm/src/modules}/_.js +0 -0
- /package/build/{modules → esm/src/modules}/feeabstraction.d.ts +0 -0
- /package/build/{modules → esm/src/modules}/feeabstraction.js +0 -0
- /package/build/{modules → esm/src/modules}/feemarket.d.ts +0 -0
- /package/build/{modules → esm/src/modules}/feemarket.js +0 -0
- /package/build/{querier.d.ts → esm/src/querier.d.ts} +0 -0
- /package/build/{querier.js → esm/src/querier.js} +0 -0
- /package/build/{registry.d.ts → esm/src/registry.d.ts} +0 -0
- /package/build/{registry.js → esm/src/registry.js} +0 -0
- /package/build/{signer.d.ts → esm/src/signer.d.ts} +0 -0
- /package/build/{signer.js → esm/src/signer.js} +0 -0
- /package/build/{types → esm/src}/utils.d.ts +0 -0
- /package/build/{utils.js → esm/src/utils.js} +0 -0
- /package/build/types/{modules → esm/src/modules}/_.d.ts +0 -0
- /package/build/types/{modules → esm/src/modules}/feeabstraction.d.ts +0 -0
- /package/build/types/{modules → esm/src/modules}/feemarket.d.ts +0 -0
- /package/build/types/{querier.d.ts → esm/src/querier.d.ts} +0 -0
- /package/build/types/{registry.d.ts → esm/src/registry.d.ts} +0 -0
- /package/build/types/{signer.d.ts → esm/src/signer.d.ts} +0 -0
- /package/build/{utils.d.ts → types/esm/src/utils.d.ts} +0 -0
|
@@ -8,6 +8,7 @@ import { CheqdNetwork } from './types.js';
|
|
|
8
8
|
import { QueryClient } from '@cosmjs/stargate';
|
|
9
9
|
import { CheqdQuerier } from './querier.js';
|
|
10
10
|
import { FeeabstractionModule, } from './modules/feeabstraction.js';
|
|
11
|
+
import { OracleModule } from '../../cjs/src/modules/oracle';
|
|
11
12
|
/**
|
|
12
13
|
* Main CheqdSDK class that provides a comprehensive interface for interacting with the Cheqd blockchain.
|
|
13
14
|
* This class orchestrates modules for DID operations, resource management, fee market interactions,
|
|
@@ -168,12 +169,13 @@ export function filterUnauthorizedMethods(methods, authorizedMethods, protectedM
|
|
|
168
169
|
export async function createCheqdSDK(options) {
|
|
169
170
|
return await new CheqdSDK(options).build();
|
|
170
171
|
}
|
|
171
|
-
export { DIDModule, ResourceModule, FeemarketModule, FeeabstractionModule };
|
|
172
|
+
export { DIDModule, ResourceModule, FeemarketModule, FeeabstractionModule, OracleModule };
|
|
172
173
|
export { AbstractCheqdSDKModule, applyMixins } from './modules/_.js';
|
|
173
174
|
export { MsgCreateDidDocResponseEncodeObject, MsgUpdateDidDocEncodeObject, MsgUpdateDidDocResponseEncodeObject, MsgDeactivateDidDocEncodeObject, contexts, defaultDidExtensionKey, protobufLiterals as protobufLiteralsDid, typeUrlMsgCreateDidDoc, typeUrlMsgCreateDidDocResponse, typeUrlMsgUpdateDidDoc, typeUrlMsgUpdateDidDocResponse, typeUrlMsgDeactivateDidDoc, typeUrlMsgDeactivateDidDocResponse, setupDidExtension, isMsgCreateDidDocEncodeObject, isMsgUpdateDidDocEncodeObject, isMsgDeactivateDidDocEncodeObject, } from './modules/did.js';
|
|
174
175
|
export { defaultResourceExtensionKey, protobufLiterals as protobufLiteralsResource, typeUrlMsgCreateResource, typeUrlMsgCreateResourceResponse, setupResourceExtension, isMsgCreateResourceEncodeObject, } from './modules/resource.js';
|
|
175
176
|
export { defaultFeemarketExtensionKey, defaultGasPriceTiers, protobufLiterals as protobufLiteralsFeemarket, typeUrlGasPriceResponse, typeUrlGasPricesResponse, typeUrlParamsResponse, setupFeemarketExtension, isGasPriceEncodeObject, isGasPricesEncodeObject, isParamsEncodeObject, } from './modules/feemarket.js';
|
|
176
177
|
export { 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.js';
|
|
178
|
+
export { defaultOracleExtensionKey, protobufLiterals as protobufLiteralsOracle, typeUrlMsgAggregateExchangeRatePrevote, typeUrlMsgAggregateExchangeRatePrevoteResponse, typeUrlMsgAggregateExchangeRateVote, typeUrlMsgAggregateExchangeRateVoteResponse, typeUrlMsgDelegateFeedConsent, typeUrlMsgDelegateFeedConsentResponse, typeUrlMsgLegacyGovUpdateParams, typeUrlMsgLegacyGovUpdateParamsResponse, typeUrlMsgGovUpdateParams, typeUrlMsgGovUpdateParamsResponse, typeUrlMsgGovAddDenoms, typeUrlMsgGovAddDenomsResponse, typeUrlMsgGovRemoveCurrencyPairProviders, typeUrlMsgGovRemoveCurrencyPairProvidersResponse, typeUrlMsgGovRemoveCurrencyDeviationThresholds, typeUrlMsgGovRemoveCurrencyDeviationThresholdsResponse, typeUrlMsgGovCancelUpdateParamPlan, typeUrlMsgGovCancelUpdateParamPlanResponse, isMsgAggregateExchangeRatePrevoteEncodeObject, isMsgAggregateExchangeRateVoteEncodeObject, isMsgDelegateFeedConsentEncodeObject, isMsgLegacyGovUpdateParamsEncodeObject, isMsgGovUpdateParamsEncodeObject, isMsgGovAddDenomsEncodeObject, isMsgGovRemoveCurrencyPairProvidersEncodeObject, isMsgGovRemoveCurrencyDeviationThresholdsEncodeObject, isMsgGovCancelUpdateParamPlanEncodeObject, setupOracleExtension, } from './modules/oracle.js';
|
|
177
179
|
export * from './signer.js';
|
|
178
180
|
export * from './querier.js';
|
|
179
181
|
export * from './registry.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAA4C,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAmC,cAAc,EAAqB,MAAM,uBAAuB,CAAC;AAC3G,OAAO,EACN,eAAe,EAGf,oBAAoB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEN,WAAW,EACX,yBAAyB,EACzB,sCAAsC,EACtC,8CAA8C,GAC9C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,YAAY,EAA8B,MAAM,YAAY,CAAC;AACtE,OAAO,EAAY,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAEN,oBAAoB,GAEpB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAmD,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAsC7G;;;;GAIG;AACH,MAAM,OAAO,QAAQ;IACpB,mDAAmD;IACnD,OAAO,CAAmB;IAC1B,kEAAkE;IAClE,MAAM,CAA6B;IACnC,+DAA+D;IAC/D,OAAO,CAKU;IACjB,6DAA6D;IAC7D,OAAO,CAAmB;IAC1B,mEAAmE;IAC3D,gBAAgB,GAAa,CAAC,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;I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,WAAW,EAAE,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC5C,QAAQ,CAAC,SAAS,EAAE,iBAAiB,EAAE,QAAQ,CAAC,IAAI,CAAC;gBAErD,OAAO;YAER,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC5C,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { DeliverTxResponse, QueryClient } from '@cosmjs/stargate';
|
|
2
2
|
import { AbstractCheqdSDKModule, MinimalImportableCheqdSDKModule } from './_.js';
|
|
3
3
|
import { CheqdSigningStargateClient } from '../signer.js';
|
|
4
|
-
import { DIDDocument, DidStdFee, IContext, ISignInputs, QueryExtensionSetup, SpecValidationResult, DIDDocumentWithMetadata, AuthenticationValidationResult } from '../types.js';
|
|
5
|
-
import { MsgCreateDidDoc, MsgCreateDidDocResponse, MsgDeactivateDidDoc, MsgDeactivateDidDocResponse, MsgUpdateDidDoc, MsgUpdateDidDocResponse, SignInfo, QueryAllDidDocVersionsMetadataResponse, DidDocWithMetadata, DidDoc, Metadata } from '@cheqd/ts-proto/cheqd/did/v2/index.js';
|
|
4
|
+
import { DIDDocument, DidStdFee, IContext, ISignInputs, QueryExtensionSetup, SpecValidationResult, DIDDocumentWithMetadata, AuthenticationValidationResult, DidFeeOptions } from '../types.js';
|
|
5
|
+
import { MsgCreateDidDoc, MsgCreateDidDocResponse, MsgDeactivateDidDoc, MsgDeactivateDidDocResponse, MsgUpdateDidDoc, MsgUpdateDidDocResponse, SignInfo, QueryAllDidDocVersionsMetadataResponse, DidDocWithMetadata, DidDoc, Metadata, QueryParamsResponse, FeeRange } from '@cheqd/ts-proto/cheqd/did/v2/index.js';
|
|
6
6
|
import { EncodeObject, GeneratedType } from '@cosmjs/proto-signing';
|
|
7
7
|
import { CheqdQuerier } from '../querier.js';
|
|
8
8
|
import { DIDDocumentMetadata } from 'did-resolver';
|
|
9
|
+
import { OracleExtension } from './oracle.js';
|
|
10
|
+
import { Coin } from 'cosmjs-types/cosmos/base/v1beta1/coin.js';
|
|
9
11
|
/** Default extension key for DID-related query operations */
|
|
10
12
|
export declare const defaultDidExtensionKey: "did";
|
|
11
13
|
/**
|
|
@@ -172,6 +174,8 @@ export type DidExtension = {
|
|
|
172
174
|
readonly didDocVersion: (id: string, versionId: string) => Promise<DidDocWithMetadata>;
|
|
173
175
|
/** Query metadata for all versions of a DID document */
|
|
174
176
|
readonly allDidDocVersionsMetadata: (id: string, paginationKey?: Uint8Array) => Promise<QueryAllDidDocVersionsMetadataResponse>;
|
|
177
|
+
/** Query DID module parameters */
|
|
178
|
+
readonly params: () => Promise<QueryParamsResponse>;
|
|
175
179
|
};
|
|
176
180
|
};
|
|
177
181
|
/**
|
|
@@ -190,6 +194,10 @@ export declare class DIDModule extends AbstractCheqdSDKModule {
|
|
|
190
194
|
static readonly registryTypes: Iterable<[string, GeneratedType]>;
|
|
191
195
|
/** Base denomination for Cheqd network transactions */
|
|
192
196
|
static readonly baseMinimalDenom: "ncheq";
|
|
197
|
+
/** Base denomination in USD for Cheqd network transactions */
|
|
198
|
+
static readonly baseUsdDenom: "usd";
|
|
199
|
+
/** Default slippage tolerance in base points (BPS) */
|
|
200
|
+
static readonly defaultSlippageBps = 500n;
|
|
193
201
|
/**
|
|
194
202
|
* Standard fee amounts for DID operations.
|
|
195
203
|
* These represent the default costs for different DID document operations.
|
|
@@ -210,18 +218,45 @@ export declare class DIDModule extends AbstractCheqdSDKModule {
|
|
|
210
218
|
readonly amount: "10000000000";
|
|
211
219
|
readonly denom: "ncheq";
|
|
212
220
|
};
|
|
221
|
+
/** Default fee for creating a new DID document in USD */
|
|
222
|
+
readonly DefaultCreateDidDocFeeUSD: {
|
|
223
|
+
readonly amount: "2000000000000000000";
|
|
224
|
+
readonly denom: "usd";
|
|
225
|
+
};
|
|
226
|
+
/** Default fee for updating an existing DID document in USD */
|
|
227
|
+
readonly DefaultUpdateDidDocFeeUSD: {
|
|
228
|
+
readonly amount: "1000000000000000000";
|
|
229
|
+
readonly denom: "usd";
|
|
230
|
+
};
|
|
231
|
+
/** Default fee for deactivating a DID document in USD */
|
|
232
|
+
readonly DefaultDeactivateDidDocFeeUSD: {
|
|
233
|
+
readonly amount: "400000000000000000";
|
|
234
|
+
readonly denom: "usd";
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Standard gas limits for DID operations.
|
|
239
|
+
* These represent the default gas limits for different DID document operations.
|
|
240
|
+
*/
|
|
241
|
+
static readonly gasLimits: {
|
|
242
|
+
/** Gas limit for creating a new DID document */
|
|
243
|
+
readonly CreateDidDocGasLimit: "360000";
|
|
244
|
+
/** Gas limit for updating an existing DID document */
|
|
245
|
+
readonly UpdateDidDocGasLimit: "360000";
|
|
246
|
+
/** Gas limit for deactivating a DID document */
|
|
247
|
+
readonly DeactivateDidDocGasLimit: "360000";
|
|
213
248
|
};
|
|
214
249
|
/** Querier extension setup function for DID operations */
|
|
215
250
|
static readonly querierExtensionSetup: QueryExtensionSetup<DidExtension>;
|
|
216
251
|
/** Querier instance with DID extension capabilities */
|
|
217
|
-
querier: CheqdQuerier & DidExtension;
|
|
252
|
+
querier: CheqdQuerier & DidExtension & OracleExtension;
|
|
218
253
|
/**
|
|
219
254
|
* Constructs a new DID module instance.
|
|
220
255
|
*
|
|
221
256
|
* @param signer - Signing client for blockchain transactions
|
|
222
257
|
* @param querier - Querier client with DID extension for data retrieval
|
|
223
258
|
*/
|
|
224
|
-
constructor(signer: CheqdSigningStargateClient, querier: CheqdQuerier & DidExtension);
|
|
259
|
+
constructor(signer: CheqdSigningStargateClient, querier: CheqdQuerier & DidExtension & OracleExtension);
|
|
225
260
|
/**
|
|
226
261
|
* Gets the registry types for DID message encoding/decoding.
|
|
227
262
|
*
|
|
@@ -244,11 +279,12 @@ export declare class DIDModule extends AbstractCheqdSDKModule {
|
|
|
244
279
|
* @param fee - Transaction fee configuration or 'auto' for automatic calculation
|
|
245
280
|
* @param memo - Optional transaction memo
|
|
246
281
|
* @param versionId - Optional version identifier for the DID document
|
|
282
|
+
* @param feeOptions - Optional fee options for the transaction
|
|
247
283
|
* @param context - Optional SDK context for accessing clients
|
|
248
284
|
* @returns Promise resolving to the transaction response
|
|
249
285
|
* @throws Error if DID payload is not spec compliant or authentication is invalid
|
|
250
286
|
*/
|
|
251
|
-
createDidDocTx(signInputs: ISignInputs[] | SignInfo[], didPayload: DIDDocument, address: string, fee?: DidStdFee | 'auto' | number, memo?: string, versionId?: string, context?: IContext): Promise<DeliverTxResponse>;
|
|
287
|
+
createDidDocTx(signInputs: ISignInputs[] | SignInfo[], didPayload: DIDDocument, address: string, fee?: DidStdFee | 'auto' | number, memo?: string, versionId?: string, feeOptions?: DidFeeOptions, context?: IContext): Promise<DeliverTxResponse>;
|
|
252
288
|
/**
|
|
253
289
|
* Updates an existing DID document transaction on the blockchain.
|
|
254
290
|
* Validates the updated DID payload and handles key rotation scenarios.
|
|
@@ -259,11 +295,12 @@ export declare class DIDModule extends AbstractCheqdSDKModule {
|
|
|
259
295
|
* @param fee - Transaction fee configuration or 'auto' for automatic calculation
|
|
260
296
|
* @param memo - Optional transaction memo
|
|
261
297
|
* @param versionId - Optional version identifier for the updated DID document
|
|
298
|
+
* @param feeOptions - Optional fee options for the transaction
|
|
262
299
|
* @param context - Optional SDK context for accessing clients
|
|
263
300
|
* @returns Promise resolving to the transaction response
|
|
264
301
|
* @throws Error if DID payload is not spec compliant or authentication is invalid
|
|
265
302
|
*/
|
|
266
|
-
updateDidDocTx(signInputs: ISignInputs[] | SignInfo[], didPayload: DIDDocument, address: string, fee?: DidStdFee | 'auto' | number, memo?: string, versionId?: string, context?: IContext): Promise<DeliverTxResponse>;
|
|
303
|
+
updateDidDocTx(signInputs: ISignInputs[] | SignInfo[], didPayload: DIDDocument, address: string, fee?: DidStdFee | 'auto' | number, memo?: string, versionId?: string, feeOptions?: DidFeeOptions, context?: IContext): Promise<DeliverTxResponse>;
|
|
267
304
|
/**
|
|
268
305
|
* Deactivates an existing DID document transaction on the blockchain.
|
|
269
306
|
* Validates authentication and creates a deactivation transaction.
|
|
@@ -274,11 +311,12 @@ export declare class DIDModule extends AbstractCheqdSDKModule {
|
|
|
274
311
|
* @param fee - Transaction fee configuration or 'auto' for automatic calculation
|
|
275
312
|
* @param memo - Optional transaction memo
|
|
276
313
|
* @param versionId - Optional version identifier for the deactivation
|
|
314
|
+
* @param feeOptions - Optional fee options for the transaction
|
|
277
315
|
* @param context - Optional SDK context for accessing clients
|
|
278
316
|
* @returns Promise resolving to the transaction response
|
|
279
317
|
* @throws Error if DID payload is not spec compliant or authentication is invalid
|
|
280
318
|
*/
|
|
281
|
-
deactivateDidDocTx(signInputs: ISignInputs[] | SignInfo[], didPayload: DIDDocument, address: string, fee?: DidStdFee | 'auto' | number, memo?: string, versionId?: string, context?: IContext): Promise<DeliverTxResponse>;
|
|
319
|
+
deactivateDidDocTx(signInputs: ISignInputs[] | SignInfo[], didPayload: DIDDocument, address: string, fee?: DidStdFee | 'auto' | number, memo?: string, versionId?: string, feeOptions?: DidFeeOptions, context?: IContext): Promise<DeliverTxResponse>;
|
|
282
320
|
/**
|
|
283
321
|
* Queries a DID document by its identifier.
|
|
284
322
|
* Retrieves the latest version of the DID document with metadata.
|
|
@@ -309,6 +347,70 @@ export declare class DIDModule extends AbstractCheqdSDKModule {
|
|
|
309
347
|
didDocumentVersionsMetadata: DIDDocumentMetadata[];
|
|
310
348
|
pagination: QueryAllDidDocVersionsMetadataResponse['pagination'];
|
|
311
349
|
}>;
|
|
350
|
+
/**
|
|
351
|
+
* Queries the DID module parameters from the blockchain.
|
|
352
|
+
* @param context - Optional SDK context for accessing clients
|
|
353
|
+
* @returns Promise resolving to the DID module parameters
|
|
354
|
+
*/
|
|
355
|
+
queryParams(context?: IContext): Promise<QueryParamsResponse>;
|
|
356
|
+
/**
|
|
357
|
+
* Generates oracle-powered fees for creating a DID document.
|
|
358
|
+
*
|
|
359
|
+
* @param feePayer - Address of the account that will pay the transaction fees
|
|
360
|
+
* @param granter - Optional address of the account granting fee payment permissions
|
|
361
|
+
* @param feeOptions - Options for fetching oracle fees
|
|
362
|
+
* @param context - Optional SDK context for accessing clients
|
|
363
|
+
* @returns Promise resolving to the fee configuration for DID document creation with oracle fees
|
|
364
|
+
*/
|
|
365
|
+
generateCreateDidDocFees(feePayer: string, granter?: string, feeOptions?: DidFeeOptions, context?: IContext): Promise<DidStdFee>;
|
|
366
|
+
/**
|
|
367
|
+
* Generates oracle-powered fees for updating a DID document.
|
|
368
|
+
*
|
|
369
|
+
* @param feePayer - Address of the account that will pay the transaction fees
|
|
370
|
+
* @param granter - Optional address of the account granting fee payment permissions
|
|
371
|
+
* @param feeOptions - Options for fetching oracle fees
|
|
372
|
+
* @param context - Optional SDK context for accessing clients
|
|
373
|
+
* @returns Promise resolving to the fee configuration for DID document update with oracle fees
|
|
374
|
+
*/
|
|
375
|
+
generateUpdateDidDocFees(feePayer: string, granter?: string, fetchOptions?: DidFeeOptions, context?: IContext): Promise<DidStdFee>;
|
|
376
|
+
/** Generates oracle-powered fees for deactivating a DID document.
|
|
377
|
+
*
|
|
378
|
+
* @param feePayer - Address of the account that will pay the transaction fees
|
|
379
|
+
* @param granter - Optional address of the account granting fee payment permissions
|
|
380
|
+
* @param feeOptions - Options for fetching oracle fees
|
|
381
|
+
* @param context - Optional SDK context for accessing clients
|
|
382
|
+
* @returns Promise resolving to the fee configuration for DID document deactivation with oracle fees
|
|
383
|
+
*/
|
|
384
|
+
generateDeactivateDidDocFees(feePayer: string, granter?: string, feeOptions?: DidFeeOptions, context?: IContext): Promise<DidStdFee>;
|
|
385
|
+
/**
|
|
386
|
+
* Gets the fee range for a specific DID operation from the module parameters.
|
|
387
|
+
* @param feeParams - DID module fee parameters
|
|
388
|
+
* @param operation - DID operation type ('create', 'update', 'deactivate')
|
|
389
|
+
* @param feeOptions - Options for fee retrieval
|
|
390
|
+
* @returns Promise resolving to the fee range for the specified operation
|
|
391
|
+
*/
|
|
392
|
+
getPriceRangeFromParams(feeParams: QueryParamsResponse, operation: 'create' | 'update' | 'deactivate', feeOptions?: DidFeeOptions): Promise<FeeRange>;
|
|
393
|
+
/**
|
|
394
|
+
* Calculates the oracle fee amount based on the provided fee range and options.
|
|
395
|
+
* @param feeRange - Fee range for the DID operation
|
|
396
|
+
* @param feeOptions - Options for fee calculation
|
|
397
|
+
* @param context - Optional SDK context for accessing clients
|
|
398
|
+
* @returns Promise resolving to the calculated fee amount as a Coin
|
|
399
|
+
*/
|
|
400
|
+
private calculateOracleFeeAmount;
|
|
401
|
+
/**
|
|
402
|
+
* Applies slippage to a given coin amount based on the specified basis points.
|
|
403
|
+
* @param coin - Coin amount to apply slippage to
|
|
404
|
+
* @param slippageBps - Slippage in basis points (bps)
|
|
405
|
+
* @returns Coin with adjusted amount after applying slippage
|
|
406
|
+
*/
|
|
407
|
+
static applySlippageToCoin(coin: Coin, slippageBps: number): Coin;
|
|
408
|
+
/**
|
|
409
|
+
* Checks if a fee range represents a fixed fee (minAmount equals maxAmount).
|
|
410
|
+
* @param feeRange - Fee range to check
|
|
411
|
+
* @returns True if the fee range is fixed, false otherwise
|
|
412
|
+
*/
|
|
413
|
+
static isFixedRange(feeRange: FeeRange): boolean;
|
|
312
414
|
/**
|
|
313
415
|
* Validates a DID document against the Cheqd specification requirements.
|
|
314
416
|
* Ensures all required fields are present and verification methods are supported.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"did.d.ts","sourceRoot":"","sources":["../../../../src/modules/did.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,iBAAiB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7G,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,MAAM,QAAQ,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,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3
3
|
import { ISignInputs, VerificationMethods, } from '../types.js';
|
|
4
4
|
import { MsgCreateDidDoc, MsgCreateDidDocPayload, MsgCreateDidDocResponse, MsgDeactivateDidDoc, MsgDeactivateDidDocPayload, MsgDeactivateDidDocResponse, MsgUpdateDidDoc, MsgUpdateDidDocPayload, MsgUpdateDidDocResponse, protobufPackage, QueryClientImpl, VerificationMethod, } from '@cheqd/ts-proto/cheqd/did/v2/index.js';
|
|
5
|
+
import { parseCoins } from '@cosmjs/proto-signing';
|
|
5
6
|
import { v4 } from 'uuid';
|
|
6
7
|
import { assert } from '@cosmjs/utils';
|
|
7
8
|
import { denormalizeService, normalizeAuthentication, normalizeController, normalizeService } from '../utils.js';
|
|
9
|
+
import { defaultOracleExtensionKey, MovingAverages, WMAStrategies } from './oracle.js';
|
|
10
|
+
import { Coin } from 'cosmjs-types/cosmos/base/v1beta1/coin.js';
|
|
8
11
|
/** Default extension key for DID-related query operations */
|
|
9
12
|
export const defaultDidExtensionKey = 'did';
|
|
10
13
|
/**
|
|
@@ -154,6 +157,11 @@ export const setupDidExtension = (base) => {
|
|
|
154
157
|
});
|
|
155
158
|
return response;
|
|
156
159
|
},
|
|
160
|
+
params: async () => {
|
|
161
|
+
const response = await queryService.Params({});
|
|
162
|
+
assert(response.params);
|
|
163
|
+
return response;
|
|
164
|
+
},
|
|
157
165
|
},
|
|
158
166
|
};
|
|
159
167
|
};
|
|
@@ -173,6 +181,10 @@ export class DIDModule extends AbstractCheqdSDKModule {
|
|
|
173
181
|
];
|
|
174
182
|
/** Base denomination for Cheqd network transactions */
|
|
175
183
|
static baseMinimalDenom = 'ncheq';
|
|
184
|
+
/** Base denomination in USD for Cheqd network transactions */
|
|
185
|
+
static baseUsdDenom = 'usd';
|
|
186
|
+
/** Default slippage tolerance in base points (BPS) */
|
|
187
|
+
static defaultSlippageBps = 500n;
|
|
176
188
|
/**
|
|
177
189
|
* Standard fee amounts for DID operations.
|
|
178
190
|
* These represent the default costs for different DID document operations.
|
|
@@ -184,6 +196,24 @@ export class DIDModule extends AbstractCheqdSDKModule {
|
|
|
184
196
|
DefaultUpdateDidDocFee: { amount: '25000000000', denom: DIDModule.baseMinimalDenom },
|
|
185
197
|
/** Default fee for deactivating a DID document */
|
|
186
198
|
DefaultDeactivateDidDocFee: { amount: '10000000000', denom: DIDModule.baseMinimalDenom },
|
|
199
|
+
/** Default fee for creating a new DID document in USD */
|
|
200
|
+
DefaultCreateDidDocFeeUSD: { amount: '2000000000000000000', denom: DIDModule.baseUsdDenom },
|
|
201
|
+
/** Default fee for updating an existing DID document in USD */
|
|
202
|
+
DefaultUpdateDidDocFeeUSD: { amount: '1000000000000000000', denom: DIDModule.baseUsdDenom },
|
|
203
|
+
/** Default fee for deactivating a DID document in USD */
|
|
204
|
+
DefaultDeactivateDidDocFeeUSD: { amount: '400000000000000000', denom: DIDModule.baseUsdDenom },
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Standard gas limits for DID operations.
|
|
208
|
+
* These represent the default gas limits for different DID document operations.
|
|
209
|
+
*/
|
|
210
|
+
static gasLimits = {
|
|
211
|
+
/** Gas limit for creating a new DID document */
|
|
212
|
+
CreateDidDocGasLimit: '360000',
|
|
213
|
+
/** Gas limit for updating an existing DID document */
|
|
214
|
+
UpdateDidDocGasLimit: '360000',
|
|
215
|
+
/** Gas limit for deactivating a DID document */
|
|
216
|
+
DeactivateDidDocGasLimit: '360000',
|
|
187
217
|
};
|
|
188
218
|
/** Querier extension setup function for DID operations */
|
|
189
219
|
static querierExtensionSetup = setupDidExtension;
|
|
@@ -205,6 +235,11 @@ export class DIDModule extends AbstractCheqdSDKModule {
|
|
|
205
235
|
queryDidDoc: this.queryDidDoc.bind(this),
|
|
206
236
|
queryDidDocVersion: this.queryDidDocVersion.bind(this),
|
|
207
237
|
queryAllDidDocVersionsMetadata: this.queryAllDidDocVersionsMetadata.bind(this),
|
|
238
|
+
queryParams: this.queryParams.bind(this),
|
|
239
|
+
generateCreateDidDocFees: this.generateCreateDidDocFees.bind(this),
|
|
240
|
+
generateUpdateDidDocFees: this.generateUpdateDidDocFees.bind(this),
|
|
241
|
+
generateDeactivateDidDocFees: this.generateDeactivateDidDocFees.bind(this),
|
|
242
|
+
getPriceRangeFromParams: this.getPriceRangeFromParams.bind(this),
|
|
208
243
|
};
|
|
209
244
|
}
|
|
210
245
|
/**
|
|
@@ -233,11 +268,12 @@ export class DIDModule extends AbstractCheqdSDKModule {
|
|
|
233
268
|
* @param fee - Transaction fee configuration or 'auto' for automatic calculation
|
|
234
269
|
* @param memo - Optional transaction memo
|
|
235
270
|
* @param versionId - Optional version identifier for the DID document
|
|
271
|
+
* @param feeOptions - Optional fee options for the transaction
|
|
236
272
|
* @param context - Optional SDK context for accessing clients
|
|
237
273
|
* @returns Promise resolving to the transaction response
|
|
238
274
|
* @throws Error if DID payload is not spec compliant or authentication is invalid
|
|
239
275
|
*/
|
|
240
|
-
async createDidDocTx(signInputs, didPayload, address, fee, memo, versionId, context) {
|
|
276
|
+
async createDidDocTx(signInputs, didPayload, address, fee, memo, versionId, feeOptions, context) {
|
|
241
277
|
if (!this._signer) {
|
|
242
278
|
this._signer = context.sdk.signer;
|
|
243
279
|
}
|
|
@@ -288,7 +324,7 @@ export class DIDModule extends AbstractCheqdSDKModule {
|
|
|
288
324
|
address = (await context.sdk.options.wallet.getAccounts())[0].address;
|
|
289
325
|
}
|
|
290
326
|
if (!fee) {
|
|
291
|
-
fee = await
|
|
327
|
+
fee = await this.generateCreateDidDocFees(address, undefined, feeOptions, context);
|
|
292
328
|
}
|
|
293
329
|
return this._signer.signAndBroadcast(address, [createDidMsg], fee, memo);
|
|
294
330
|
}
|
|
@@ -302,11 +338,12 @@ export class DIDModule extends AbstractCheqdSDKModule {
|
|
|
302
338
|
* @param fee - Transaction fee configuration or 'auto' for automatic calculation
|
|
303
339
|
* @param memo - Optional transaction memo
|
|
304
340
|
* @param versionId - Optional version identifier for the updated DID document
|
|
341
|
+
* @param feeOptions - Optional fee options for the transaction
|
|
305
342
|
* @param context - Optional SDK context for accessing clients
|
|
306
343
|
* @returns Promise resolving to the transaction response
|
|
307
344
|
* @throws Error if DID payload is not spec compliant or authentication is invalid
|
|
308
345
|
*/
|
|
309
|
-
async updateDidDocTx(signInputs, didPayload, address, fee, memo, versionId, context) {
|
|
346
|
+
async updateDidDocTx(signInputs, didPayload, address, fee, memo, versionId, feeOptions, context) {
|
|
310
347
|
if (!this._signer) {
|
|
311
348
|
this._signer = context.sdk.signer;
|
|
312
349
|
}
|
|
@@ -357,7 +394,7 @@ export class DIDModule extends AbstractCheqdSDKModule {
|
|
|
357
394
|
address = (await context.sdk.options.wallet.getAccounts())[0].address;
|
|
358
395
|
}
|
|
359
396
|
if (!fee) {
|
|
360
|
-
fee = await
|
|
397
|
+
fee = await this.generateUpdateDidDocFees(address, undefined, feeOptions, context);
|
|
361
398
|
}
|
|
362
399
|
return this._signer.signAndBroadcast(address, [updateDidMsg], fee, memo);
|
|
363
400
|
}
|
|
@@ -371,11 +408,12 @@ export class DIDModule extends AbstractCheqdSDKModule {
|
|
|
371
408
|
* @param fee - Transaction fee configuration or 'auto' for automatic calculation
|
|
372
409
|
* @param memo - Optional transaction memo
|
|
373
410
|
* @param versionId - Optional version identifier for the deactivation
|
|
411
|
+
* @param feeOptions - Optional fee options for the transaction
|
|
374
412
|
* @param context - Optional SDK context for accessing clients
|
|
375
413
|
* @returns Promise resolving to the transaction response
|
|
376
414
|
* @throws Error if DID payload is not spec compliant or authentication is invalid
|
|
377
415
|
*/
|
|
378
|
-
async deactivateDidDocTx(signInputs, didPayload, address, fee, memo, versionId, context) {
|
|
416
|
+
async deactivateDidDocTx(signInputs, didPayload, address, fee, memo, versionId, feeOptions, context) {
|
|
379
417
|
if (!this._signer) {
|
|
380
418
|
this._signer = context.sdk.signer;
|
|
381
419
|
}
|
|
@@ -413,7 +451,7 @@ export class DIDModule extends AbstractCheqdSDKModule {
|
|
|
413
451
|
address = (await context.sdk.options.wallet.getAccounts())[0].address;
|
|
414
452
|
}
|
|
415
453
|
if (!fee) {
|
|
416
|
-
fee = await
|
|
454
|
+
fee = await this.generateDeactivateDidDocFees(address, undefined, feeOptions, context);
|
|
417
455
|
}
|
|
418
456
|
return this._signer.signAndBroadcast(address, [deactivateDidMsg], fee, memo);
|
|
419
457
|
}
|
|
@@ -471,6 +509,174 @@ export class DIDModule extends AbstractCheqdSDKModule {
|
|
|
471
509
|
pagination,
|
|
472
510
|
};
|
|
473
511
|
}
|
|
512
|
+
/**
|
|
513
|
+
* Queries the DID module parameters from the blockchain.
|
|
514
|
+
* @param context - Optional SDK context for accessing clients
|
|
515
|
+
* @returns Promise resolving to the DID module parameters
|
|
516
|
+
*/
|
|
517
|
+
async queryParams(context) {
|
|
518
|
+
if (!this.querier) {
|
|
519
|
+
this.querier = context.sdk.querier;
|
|
520
|
+
}
|
|
521
|
+
return this.querier[defaultDidExtensionKey].params();
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Generates oracle-powered fees for creating a DID document.
|
|
525
|
+
*
|
|
526
|
+
* @param feePayer - Address of the account that will pay the transaction fees
|
|
527
|
+
* @param granter - Optional address of the account granting fee payment permissions
|
|
528
|
+
* @param feeOptions - Options for fetching oracle fees
|
|
529
|
+
* @param context - Optional SDK context for accessing clients
|
|
530
|
+
* @returns Promise resolving to the fee configuration for DID document creation with oracle fees
|
|
531
|
+
*/
|
|
532
|
+
async generateCreateDidDocFees(feePayer, granter, feeOptions, context) {
|
|
533
|
+
if (!this.querier) {
|
|
534
|
+
this.querier = context.sdk.querier;
|
|
535
|
+
}
|
|
536
|
+
// fetch fee parameters from the DID module
|
|
537
|
+
const feeParams = await this.queryParams(context);
|
|
538
|
+
// get the price range for the create operation
|
|
539
|
+
const priceRange = await this.getPriceRangeFromParams(feeParams, 'create', feeOptions);
|
|
540
|
+
// calculate the oracle fee amount based on the price range and options
|
|
541
|
+
return {
|
|
542
|
+
amount: [await this.calculateOracleFeeAmount(priceRange, feeOptions, context)],
|
|
543
|
+
gas: feeOptions?.gasLimit || DIDModule.gasLimits.CreateDidDocGasLimit,
|
|
544
|
+
payer: feePayer,
|
|
545
|
+
granter,
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Generates oracle-powered fees for updating a DID document.
|
|
550
|
+
*
|
|
551
|
+
* @param feePayer - Address of the account that will pay the transaction fees
|
|
552
|
+
* @param granter - Optional address of the account granting fee payment permissions
|
|
553
|
+
* @param feeOptions - Options for fetching oracle fees
|
|
554
|
+
* @param context - Optional SDK context for accessing clients
|
|
555
|
+
* @returns Promise resolving to the fee configuration for DID document update with oracle fees
|
|
556
|
+
*/
|
|
557
|
+
async generateUpdateDidDocFees(feePayer, granter, fetchOptions, context) {
|
|
558
|
+
if (!this.querier) {
|
|
559
|
+
this.querier = context.sdk.querier;
|
|
560
|
+
}
|
|
561
|
+
// fetch fee parameters from the DID module
|
|
562
|
+
const feeParams = await this.queryParams(context);
|
|
563
|
+
// get the price range for the update operation
|
|
564
|
+
const priceRange = await this.getPriceRangeFromParams(feeParams, 'update', fetchOptions);
|
|
565
|
+
// calculate the oracle fee amount based on the price range and options
|
|
566
|
+
return {
|
|
567
|
+
amount: [await this.calculateOracleFeeAmount(priceRange, fetchOptions, context)],
|
|
568
|
+
gas: fetchOptions?.gasLimit || DIDModule.gasLimits.UpdateDidDocGasLimit,
|
|
569
|
+
payer: feePayer,
|
|
570
|
+
granter,
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
/** Generates oracle-powered fees for deactivating a DID document.
|
|
574
|
+
*
|
|
575
|
+
* @param feePayer - Address of the account that will pay the transaction fees
|
|
576
|
+
* @param granter - Optional address of the account granting fee payment permissions
|
|
577
|
+
* @param feeOptions - Options for fetching oracle fees
|
|
578
|
+
* @param context - Optional SDK context for accessing clients
|
|
579
|
+
* @returns Promise resolving to the fee configuration for DID document deactivation with oracle fees
|
|
580
|
+
*/
|
|
581
|
+
async generateDeactivateDidDocFees(feePayer, granter, feeOptions, context) {
|
|
582
|
+
if (!this.querier) {
|
|
583
|
+
this.querier = context.sdk.querier;
|
|
584
|
+
}
|
|
585
|
+
// fetch fee parameters from the DID module
|
|
586
|
+
const feeParams = await this.queryParams(context);
|
|
587
|
+
// get the price range for the deactivate operation
|
|
588
|
+
const priceRange = await this.getPriceRangeFromParams(feeParams, 'deactivate', feeOptions);
|
|
589
|
+
// calculate the oracle fee amount based on the price range and options
|
|
590
|
+
return {
|
|
591
|
+
amount: [await this.calculateOracleFeeAmount(priceRange, feeOptions, context)],
|
|
592
|
+
gas: feeOptions?.gasLimit || DIDModule.gasLimits.DeactivateDidDocGasLimit,
|
|
593
|
+
payer: feePayer,
|
|
594
|
+
granter,
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Gets the fee range for a specific DID operation from the module parameters.
|
|
599
|
+
* @param feeParams - DID module fee parameters
|
|
600
|
+
* @param operation - DID operation type ('create', 'update', 'deactivate')
|
|
601
|
+
* @param feeOptions - Options for fee retrieval
|
|
602
|
+
* @returns Promise resolving to the fee range for the specified operation
|
|
603
|
+
*/
|
|
604
|
+
async getPriceRangeFromParams(feeParams, operation, feeOptions) {
|
|
605
|
+
const operationFees = (() => {
|
|
606
|
+
switch (operation) {
|
|
607
|
+
case 'create':
|
|
608
|
+
return feeParams.params?.createDid.find((fee) => fee.denom === (feeOptions?.feeDenom ?? DIDModule.baseUsdDenom));
|
|
609
|
+
case 'update':
|
|
610
|
+
return feeParams.params?.updateDid.find((fee) => fee.denom === (feeOptions?.feeDenom ?? DIDModule.baseUsdDenom));
|
|
611
|
+
case 'deactivate':
|
|
612
|
+
return feeParams.params?.deactivateDid.find((fee) => fee.denom === (feeOptions?.feeDenom ?? DIDModule.baseUsdDenom));
|
|
613
|
+
default:
|
|
614
|
+
throw new Error('Unsupported operation for fee retrieval');
|
|
615
|
+
}
|
|
616
|
+
})();
|
|
617
|
+
if (!operationFees) {
|
|
618
|
+
throw new Error(`Fee parameters not found for operation: ${operation}`);
|
|
619
|
+
}
|
|
620
|
+
return operationFees;
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Calculates the oracle fee amount based on the provided fee range and options.
|
|
624
|
+
* @param feeRange - Fee range for the DID operation
|
|
625
|
+
* @param feeOptions - Options for fee calculation
|
|
626
|
+
* @param context - Optional SDK context for accessing clients
|
|
627
|
+
* @returns Promise resolving to the calculated fee amount as a Coin
|
|
628
|
+
*/
|
|
629
|
+
async calculateOracleFeeAmount(feeRange, feeOptions, context) {
|
|
630
|
+
if (!this.querier) {
|
|
631
|
+
this.querier = context.sdk.querier;
|
|
632
|
+
}
|
|
633
|
+
if (feeRange.denom !== feeOptions?.feeDenom && feeOptions?.feeDenom !== undefined) {
|
|
634
|
+
throw new Error(`Fee denomination mismatch: expected ${feeRange.denom}, got ${feeOptions.feeDenom}`);
|
|
635
|
+
}
|
|
636
|
+
const wantedFeeAmount = feeRange.denom === DIDModule.baseUsdDenom
|
|
637
|
+
? (feeOptions?.wantedAmountUsd ?? DIDModule.isFixedRange(feeRange))
|
|
638
|
+
? feeRange.minAmount
|
|
639
|
+
: feeRange.minAmount
|
|
640
|
+
: feeRange.minAmount;
|
|
641
|
+
// override fee options, if unassigned - case: moving average type
|
|
642
|
+
feeOptions = {
|
|
643
|
+
...feeOptions,
|
|
644
|
+
movingAverageType: feeOptions?.movingAverageType || MovingAverages.WMA,
|
|
645
|
+
};
|
|
646
|
+
// override fee options, if unassigned - case: WMA strategy
|
|
647
|
+
feeOptions = {
|
|
648
|
+
...feeOptions,
|
|
649
|
+
wmaStrategy: feeOptions?.wmaStrategy || feeOptions?.movingAverageType === MovingAverages.WMA
|
|
650
|
+
? WMAStrategies.BALANCED
|
|
651
|
+
: undefined,
|
|
652
|
+
};
|
|
653
|
+
const convertedFeeAmount = feeRange.denom === DIDModule.baseUsdDenom
|
|
654
|
+
? parseCoins((await this.querier[defaultOracleExtensionKey].convertUSDtoCHEQ(wantedFeeAmount, feeOptions?.movingAverageType, feeOptions?.wmaStrategy, feeOptions?.wmaWeights?.map((w) => BigInt(w)))).amount)[0]
|
|
655
|
+
: Coin.fromPartial({ amount: wantedFeeAmount, denom: feeRange.denom });
|
|
656
|
+
return feeOptions?.slippageBps
|
|
657
|
+
? DIDModule.applySlippageToCoin(convertedFeeAmount, feeOptions.slippageBps)
|
|
658
|
+
: convertedFeeAmount;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Applies slippage to a given coin amount based on the specified basis points.
|
|
662
|
+
* @param coin - Coin amount to apply slippage to
|
|
663
|
+
* @param slippageBps - Slippage in basis points (bps)
|
|
664
|
+
* @returns Coin with adjusted amount after applying slippage
|
|
665
|
+
*/
|
|
666
|
+
static applySlippageToCoin(coin, slippageBps) {
|
|
667
|
+
const base = BigInt(coin.amount);
|
|
668
|
+
const delta = (base * BigInt(slippageBps)) / BigInt(10_000);
|
|
669
|
+
const adjustedAmount = base + delta;
|
|
670
|
+
return Coin.fromPartial({ amount: adjustedAmount.toString(), denom: coin.denom });
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Checks if a fee range represents a fixed fee (minAmount equals maxAmount).
|
|
674
|
+
* @param feeRange - Fee range to check
|
|
675
|
+
* @returns True if the fee range is fixed, false otherwise
|
|
676
|
+
*/
|
|
677
|
+
static isFixedRange(feeRange) {
|
|
678
|
+
return feeRange.minAmount === feeRange.maxAmount;
|
|
679
|
+
}
|
|
474
680
|
/**
|
|
475
681
|
* Validates a DID document against the Cheqd specification requirements.
|
|
476
682
|
* Ensures all required fields are present and verification methods are supported.
|